Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:59

0001 // Created on: 2019-03-27
0002 // Created by: Timur Izmaylov
0003 // Copyright (c) 2019 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Standard_Std_HeaderFile
0017 #define _Standard_Std_HeaderFile
0018 
0019 
0020 #include <type_traits>
0021 
0022 
0023 //! Namespace opencascade is intended for low-level template classes and functions
0024 namespace opencascade
0025 {
0026 
0027   //! Namespace opencascade::std includes templates from C++11 std namespace used by
0028   //! OCCT classes. These definitions are imported from std namespace, plus (on older
0029   //! compilers) from std::tr1, or implemented by custom code where neither std
0030   //! not std::tr1 provide necessary definitions.
0031   namespace std
0032   {
0033     // import all available standard stuff from std namespace
0034     using namespace ::std;
0035 
0036   } // namespace std
0037 
0038   //! Trait yielding true if class T1 is base of T2 but not the same
0039   template <class T1, class T2, class Dummy = void>
0040   struct is_base_but_not_same : opencascade::std::is_base_of<T1, T2>
0041   {
0042   };
0043 
0044   //! Explicit specialization of is_base_of trait to workaround the
0045   //! requirement of type to be complete when T1 and T2 are the same.
0046   template <class T1, class T2>
0047   struct is_base_but_not_same<T1,
0048                               T2,
0049                               typename opencascade::std::enable_if<opencascade::std::is_same<T1, T2>::value>::type>
0050   : opencascade::std::false_type
0051   {
0052   };
0053 
0054   //! The type trait that checks if the passed type is integer (it must be integral and not boolean)
0055   //! @tparam TheInteger the checked type
0056   template <typename TheInteger>
0057   struct is_integer : std::integral_constant<bool,
0058                                              opencascade::std::is_integral<TheInteger>::value
0059                                                && !opencascade::std::is_same<TheInteger, bool>::value>
0060   {
0061   };
0062 
0063   //! The auxiliary template that is used for template argument deduction in function templates. A function argument
0064   //! which type is a template type parameter and it is not needed to be deducted must be declared using this class
0065   //! template based on the type of some other template type parameter of a function template
0066   //! @tparam TheType the type that is used as a function argument type to prevent its deduction
0067   template <typename TheType>
0068   struct disable_deduction
0069   {
0070     typedef TheType type;
0071   };
0072 
0073 } // namespace opencascade
0074 
0075 #endif