Go to the documentation of this file.00001 #ifndef __BOOST_REFLECT_VOID_HPP
00002 #define __BOOST_REFLECT_VOID_HPP
00003 #include <iostream>
00004
00005 namespace boost { namespace reflect {
00006
00007
00008
00009
00010
00011
00012
00013
00014 struct void_t{
00015 friend std::ostream& operator<<(std::ostream& os,const void_t&) {return os;}
00016 friend std::istream& operator>>(std::istream& is,void_t&) {return is;}
00017 };
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 template<typename R, typename Functor=int>
00028 struct adapt_void {
00029 typedef R result_type;
00030
00031 adapt_void( const Functor _f):f(_f){}
00032
00033 template<typename Seq>
00034 result_type operator()( const Seq& seq )const {
00035 return f(seq);
00036 }
00037 template<typename Seq>
00038 result_type operator()( Seq& seq )const {
00039 return f(seq);
00040 }
00041 Functor f;
00042 };
00043 #ifndef DOXYGEN
00044 template<typename Functor>
00045 struct adapt_void<void,Functor> {
00046 typedef void_t result_type;
00047 adapt_void( const Functor _f):f(_f){}
00048
00049 template<typename Seq>
00050 result_type operator()( const Seq& seq )const {
00051 f(seq); return result_type();
00052 }
00053 template<typename Seq>
00054 result_type operator()( Seq& seq )const {
00055 f(seq); return result_type();
00056 }
00057 Functor f;
00058 };
00059 #endif
00060 } }
00061
00062 #endif