ITK  5.2.0
Insight Toolkit
itkIsConvertible.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkIsConvertible_h
19 #define itkIsConvertible_h
20 
22 
23 namespace itk
24 {
25 
28 namespace mpl
29 {
30 namespace Details
31 {
32 
38 struct SfinaeTypes
39 {
40  using TOne = char;
41  using TTwo = struct
42  {
43  char arr__[2];
44  };
45 };
46 } // namespace Details
47 
59 template <typename TFrom, typename TTo>
60 struct IsConvertible : private Details::SfinaeTypes
61 {
62 private:
63  static TOne Test(TTo);
64  static TTwo
65  Test(...);
66  static TFrom
67  MakeT();
69 
70 public:
71  static constexpr bool Value = sizeof(Test(MakeT())) == sizeof(TOne);
72 };
73 
74 } // end namespace mpl
75 
76 // itk::IsConvertible has moved to itk::mpl.
77 // Expect itk::IsConvertible to be deprecated.
78 using mpl::IsConvertible;
79 
82 } // end namespace itk
83 #endif // itkIsConvertible_h
itkMetaProgrammingLibrary.h
Details
Definition: itkVariableLengthVector.h:1044
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24