Mirror reflection library 0.5.13

mirror/meta_prog/if.hpp

Go to the documentation of this file.
00001 
00010 #ifndef MIRROR_META_PROG_IF_1011291729_HPP
00011 #define MIRROR_META_PROG_IF_1011291729_HPP
00012 
00013 
00014 #include <mirror/meta_prog/forward_decl.hpp>
00015 
00016 MIRROR_NAMESPACE_BEGIN
00017 namespace mp {
00018 
00019 template <class IfTrue, class IfFalse>
00020 struct if_<std::true_type, IfTrue, IfFalse>
00021 {
00022     typedef IfTrue type;
00023 };
00024 
00025 template <class IfTrue, class IfFalse>
00026 struct if_<std::false_type, IfTrue, IfFalse>
00027 {
00028     typedef IfFalse type;
00029 };
00030 
00031 #ifdef MIRROR_DOCUMENTATION_ONLY
00032 
00033 
00040 template <class BooleanConstant, class IfTrue, class IfFalse>
00041 struct if_
00042 {
00044     typedef unspecified type;
00045 };
00046 #else
00047 template <typename X, class IfTrue, class IfFalse>
00048 struct if_ : public if_<
00049     std::integral_constant<bool, X::type::value>,
00050     IfTrue,
00051     IfFalse
00052 >
00053 { };
00054 #endif
00055 
00056 #ifdef MIRROR_DOCUMENTATION_ONLY
00057 
00058 
00065 template <bool BooleanConstant, class IfTrue, class IfFalse>
00066 struct if_c
00067 {
00069     typedef unspecified type;
00070 };
00071 #else
00072 template <bool Value, class IfTrue, class IfFalse>
00073 struct if_c : public if_<
00074     std::integral_constant<bool, Value>,
00075     IfTrue,
00076     IfFalse
00077 >
00078 { };
00079 #endif
00080 
00081 
00082 } // namespace mp
00083 MIRROR_NAMESPACE_END
00084 
00085 #endif //include guard
00086 

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.