Mirror reflection library 0.5.13

mirror/meta_prog/concat.hpp

Go to the documentation of this file.
00001 
00012 #ifndef MIRROR_META_PROG_CONCAT_1011291729_HPP
00013 #define MIRROR_META_PROG_CONCAT_1011291729_HPP
00014 
00015 
00016 #include <mirror/meta_prog/range.hpp>
00017 
00018 MIRROR_NAMESPACE_BEGIN
00019 namespace mp {
00020 
00021 #ifdef MIRROR_DOCUMENTATION_ONLY
00022 
00023 
00029 template <class Range1, class ... Ranges>
00030 struct concat
00031 {
00032     typedef Range type;
00033 };
00034 #endif
00035 
00036 template <>
00037 struct concat<>
00038 {
00039     typedef empty_range type;
00040 };
00041 
00042 // specialization for a single range
00043 template <typename ... P>
00044 struct concat<range<P...> >
00045 {
00046     typedef range<P...> type;
00047 };
00048 
00049 // specialization for two ranges
00050 template <typename ... P1, typename ... P2>
00051 struct concat<range<P1...>, range<P2...> >
00052 {
00053     typedef range<P1..., P2...> type;
00054 };
00055 
00056 // specialization for two range expressions
00057 template <typename X1, typename X2>
00058 struct concat<X1, X2>
00059 {
00060     MIRROR_ASSERT_RETURNS_RANGE(X1);
00061     MIRROR_ASSERT_RETURNS_RANGE(X2);
00062 
00063     typedef typename concat<
00064         typename X1::type,
00065         typename X2::type
00066     >::type type;
00067 };
00068 
00069 template <typename X1, typename X2, typename ... Xs>
00070 struct concat<X1, X2, Xs...>
00071 {
00072     typedef typename concat<
00073         X1,
00074         typename concat<X2, Xs...>::type
00075     >::type type;
00076 };
00077 
00078 
00079 } // namespace mp
00080 MIRROR_NAMESPACE_END
00081 
00082 #endif //include guard
00083 

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.