Mirror reflection library 0.5.13

mirror/meta_prog/transform.hpp

Go to the documentation of this file.
00001 
00012 #ifndef MIRROR_META_PROG_TRANSFORM_1011291729_HPP
00013 #define MIRROR_META_PROG_TRANSFORM_1011291729_HPP
00014 
00015 
00016 #include <mirror/meta_prog/range.hpp>
00017 #include <mirror/meta_prog/traits.hpp>
00018 #include <mirror/meta_prog/lambda.hpp>
00019 
00020 MIRROR_NAMESPACE_BEGIN
00021 namespace mp {
00022 
00023 #ifdef MIRROR_DOCUMENTATION_ONLY
00024 
00025 
00031 template <class Range, class UnaryMetaFnClass>
00032 struct transform
00033 {
00034     typedef Range type;
00035 };
00036 #endif
00037 
00038 template <typename ... P, class UnaryMetaFnClass>
00039 struct transform<range<P...>, UnaryMetaFnClass>
00040 {
00041     typedef range<
00042         typename apply<UnaryMetaFnClass, P>::type ...
00043     > type;
00044 };
00045 
00046 // specialization for range expressions
00047 template <typename X, class Predicate>
00048 struct transform
00049 {
00050     MIRROR_ASSERT_RETURNS_RANGE(X);
00051     typedef typename transform<typename X::type, Predicate>::type type;
00052 };
00053 
00054 } // namespace mp
00055 MIRROR_NAMESPACE_END
00056 
00057 #endif //include guard
00058 

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.