Go to the documentation of this file.00001
00006 #ifndef ANY_HH
00007 #define ANY_HH
00008
00009 #include"internal/untyped_value.hh"
00010
00011 namespace my_lib {
00012
00013 struct any;
00014
00023 template<typename T>
00024 bool any_typeof(const any& a);
00025
00036 template<typename T>
00037 T any_cast(const any& a);
00038
00041 std::ostream& operator<<(std::ostream& o, const any& a);
00042
00049 struct any{
00051 template<typename T>
00052 friend T any_cast(const any& a);
00054 template<typename T>
00055 friend bool any_typeof(const any& a);
00057 friend std::ostream& operator<<(std::ostream& o, const any& a);
00058 private:
00060 internal::untyped_value* val;
00061 public:
00067 template<typename T>
00068 any(const T& t) ;
00072 any(const any& a) ;
00073 template<typename T>
00077 any& operator =(const any& a) ;
00083 template<typename T>
00084 any& operator =(const T& t) ;
00086 ~any();
00087 };
00088
00089 }
00090
00091 #include"any.hxx"
00092 #endif //ANY_HH