From 08c09b86b3217d1840389376c614fec13c63451a Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Fri, 26 Aug 2005 02:11:15 +0000 Subject: [PATCH] initial commit [SVN r30676] --- .gitattributes | 96 +++++++++++ include/boost/typeof/config.hpp | 35 ++++ include/boost/typeof/encode_decode.hpp | 34 ++++ include/boost/typeof/encode_decode_params.hpp | 34 ++++ .../typeof/increment_registration_group.hpp | 21 +++ include/boost/typeof/int_encoding.hpp | 113 +++++++++++++ .../boost/typeof/integral_template_param.hpp | 80 +++++++++ include/boost/typeof/limit_size.hpp | 35 ++++ include/boost/typeof/lvalue_typeof.hpp | 111 +++++++++++++ include/boost/typeof/message.hpp | 8 + include/boost/typeof/modifiers.hpp | 91 ++++++++++ include/boost/typeof/msvc/typeof_impl.hpp | 156 ++++++++++++++++++ .../boost/typeof/pointers_data_members.hpp | 44 +++++ include/boost/typeof/register_functions.hpp | 45 +++++ .../typeof/register_functions_iterate.hpp | 84 ++++++++++ include/boost/typeof/register_fundamental.hpp | 64 +++++++ .../boost/typeof/register_mem_functions.hpp | 32 ++++ include/boost/typeof/std/bitset.hpp | 17 ++ include/boost/typeof/std/complex.hpp | 17 ++ include/boost/typeof/std/deque.hpp | 21 +++ include/boost/typeof/std/fstream.hpp | 39 +++++ include/boost/typeof/std/functional.hpp | 49 ++++++ include/boost/typeof/std/iostream.hpp | 22 +++ include/boost/typeof/std/istream.hpp | 29 ++++ include/boost/typeof/std/iterator.hpp | 76 +++++++++ include/boost/typeof/std/list.hpp | 21 +++ include/boost/typeof/std/locale.hpp | 42 +++++ include/boost/typeof/std/map.hpp | 29 ++++ include/boost/typeof/std/memory.hpp | 19 +++ include/boost/typeof/std/ostream.hpp | 24 +++ include/boost/typeof/std/queue.hpp | 21 +++ include/boost/typeof/std/set.hpp | 28 ++++ include/boost/typeof/std/sstream.hpp | 44 +++++ include/boost/typeof/std/stack.hpp | 21 +++ include/boost/typeof/std/streambuf.hpp | 21 +++ include/boost/typeof/std/string.hpp | 26 +++ include/boost/typeof/std/utility.hpp | 17 ++ include/boost/typeof/std/valarray.hpp | 23 +++ include/boost/typeof/std/vector.hpp | 21 +++ include/boost/typeof/template_encoding.hpp | 148 +++++++++++++++++ .../boost/typeof/template_template_param.hpp | 126 ++++++++++++++ include/boost/typeof/type_encoding.hpp | 24 +++ include/boost/typeof/type_template_param.hpp | 37 +++++ include/boost/typeof/typeof.hpp | 89 ++++++++++ include/boost/typeof/typeof_impl.hpp | 59 +++++++ include/boost/typeof/vector.hpp | 87 ++++++++++ 46 files changed, 2280 insertions(+) create mode 100644 .gitattributes create mode 100755 include/boost/typeof/config.hpp create mode 100755 include/boost/typeof/encode_decode.hpp create mode 100755 include/boost/typeof/encode_decode_params.hpp create mode 100755 include/boost/typeof/increment_registration_group.hpp create mode 100755 include/boost/typeof/int_encoding.hpp create mode 100755 include/boost/typeof/integral_template_param.hpp create mode 100755 include/boost/typeof/limit_size.hpp create mode 100755 include/boost/typeof/lvalue_typeof.hpp create mode 100755 include/boost/typeof/message.hpp create mode 100755 include/boost/typeof/modifiers.hpp create mode 100755 include/boost/typeof/msvc/typeof_impl.hpp create mode 100755 include/boost/typeof/pointers_data_members.hpp create mode 100755 include/boost/typeof/register_functions.hpp create mode 100755 include/boost/typeof/register_functions_iterate.hpp create mode 100755 include/boost/typeof/register_fundamental.hpp create mode 100755 include/boost/typeof/register_mem_functions.hpp create mode 100755 include/boost/typeof/std/bitset.hpp create mode 100755 include/boost/typeof/std/complex.hpp create mode 100755 include/boost/typeof/std/deque.hpp create mode 100755 include/boost/typeof/std/fstream.hpp create mode 100755 include/boost/typeof/std/functional.hpp create mode 100755 include/boost/typeof/std/iostream.hpp create mode 100755 include/boost/typeof/std/istream.hpp create mode 100755 include/boost/typeof/std/iterator.hpp create mode 100755 include/boost/typeof/std/list.hpp create mode 100755 include/boost/typeof/std/locale.hpp create mode 100755 include/boost/typeof/std/map.hpp create mode 100755 include/boost/typeof/std/memory.hpp create mode 100755 include/boost/typeof/std/ostream.hpp create mode 100755 include/boost/typeof/std/queue.hpp create mode 100755 include/boost/typeof/std/set.hpp create mode 100755 include/boost/typeof/std/sstream.hpp create mode 100755 include/boost/typeof/std/stack.hpp create mode 100755 include/boost/typeof/std/streambuf.hpp create mode 100755 include/boost/typeof/std/string.hpp create mode 100755 include/boost/typeof/std/utility.hpp create mode 100755 include/boost/typeof/std/valarray.hpp create mode 100755 include/boost/typeof/std/vector.hpp create mode 100755 include/boost/typeof/template_encoding.hpp create mode 100755 include/boost/typeof/template_template_param.hpp create mode 100755 include/boost/typeof/type_encoding.hpp create mode 100755 include/boost/typeof/type_template_param.hpp create mode 100755 include/boost/typeof/typeof.hpp create mode 100755 include/boost/typeof/typeof_impl.hpp create mode 100755 include/boost/typeof/vector.hpp diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e84d7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/include/boost/typeof/config.hpp b/include/boost/typeof/config.hpp new file mode 100755 index 0000000..9f3e57c --- /dev/null +++ b/include/boost/typeof/config.hpp @@ -0,0 +1,35 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_CONFIG_HPP_INCLUDED +#define BOOST_TYPEOF_CONFIG_HPP_INCLUDED + +#include +#include + +#if !defined(BOOST_TYPEOF_COMPLIANT) &&\ + !defined(BOOST_TYPEOF_NATIVE) + +# if defined __GNUC__ +# define BOOST_TYPEOF_NATIVE + +# elif defined __MWERKS__ +# define BOOST_TYPEOF_NATIVE + +# elif defined(BOOST_MSVC) && (BOOST_MSVC<1400) +//Doesn't require registration +# define BOOST_TYPEOF_NATIVE + +# else +# define BOOST_TYPEOF_COMPLIANT + +# endif + +#endif + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# define BOOST_TYPEOF_NO_SIMPLE_TYPE_OPTIMIZATION +#endif + +#endif//BOOST_TYPEOF_CONFIG_HPP_INCLUDED diff --git a/include/boost/typeof/encode_decode.hpp b/include/boost/typeof/encode_decode.hpp new file mode 100755 index 0000000..67bf9e5 --- /dev/null +++ b/include/boost/typeof/encode_decode.hpp @@ -0,0 +1,34 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED +#define BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED + +#include +#include + +namespace boost{namespace type_of{namespace{ + + template + struct encode_type_impl; + + template + struct decode_type_impl + { + typedef int type; // MSVC ETI workaround + }; + + template + struct encode_type : encode_type_impl + {}; + + template + struct decode_type : decode_type_impl< + typename Iter::type, + typename Iter::next + > + {}; +}}} + +#endif//BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED diff --git a/include/boost/typeof/encode_decode_params.hpp b/include/boost/typeof/encode_decode_params.hpp new file mode 100755 index 0000000..1b019f6 --- /dev/null +++ b/include/boost/typeof/encode_decode_params.hpp @@ -0,0 +1,34 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED +#define BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED + +#include +#include + +// Assumes iter0 contains initial iterator + +#define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \ + typedef decode_type decode##n; \ + typedef typename decode##n::type p##n; \ + typedef typename decode##n::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); + +#define BOOST_TYPEOF_DECODE_PARAMS(n)\ + BOOST_PP_REPEAT(n, BOOST_TYPEOF_DECODE_PARAM, ~) + +// The P0, P1, ... PN are encoded and added to V + +#define BOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\ + typename encode_type< + +#define BOOST_TYPEOF_ENCODE_PARAMS_END(z, n, text)\ + , BOOST_PP_CAT(P, n)>::type + +#define BOOST_TYPEOF_ENCODE_PARAMS(n, ID) \ + BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_BEGIN, ~) \ + typename push_back >::type \ + BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_END, ~) + +#endif//BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED diff --git a/include/boost/typeof/increment_registration_group.hpp b/include/boost/typeof/increment_registration_group.hpp new file mode 100755 index 0000000..0509e1a --- /dev/null +++ b/include/boost/typeof/increment_registration_group.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// Inclusion of this file increments BOOST_TYPEOF_REGISTRATION_GROUP +// This method was suggested by Paul Mensonides + +#ifndef BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP_HPP_INCLUDED + +# define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP_HPP_INCLUDED +# include +# define BOOST_TYPEOF_REGISTRATION_GROUP 0 + +#else + +# define BOOST_PP_VALUE BOOST_TYPEOF_REGISTRATION_GROUP + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# undef BOOST_TYPEOF_REGISTRATION_GROUP +# define BOOST_TYPEOF_REGISTRATION_GROUP BOOST_PP_SLOT(1) + +#endif//BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP_HPP_INCLUDED diff --git a/include/boost/typeof/int_encoding.hpp b/include/boost/typeof/int_encoding.hpp new file mode 100755 index 0000000..667c683 --- /dev/null +++ b/include/boost/typeof/int_encoding.hpp @@ -0,0 +1,113 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_INT_ENCODING_HPP_INCLUDED +#define BOOST_TYPEOF_INT_ENCODING_HPP_INCLUDED + +#include +#include + +namespace boost{namespace type_of{ + + template struct get_unsigned + { + typedef T type; + }; + template<> struct get_unsigned + { + typedef unsigned char type; + }; + template<> struct get_unsigned + { + typedef unsigned char type; + }; + template<> struct get_unsigned + { + typedef unsigned short type; + }; + template<> struct get_unsigned + { + typedef unsigned int type; + }; + template<> struct get_unsigned + { + typedef unsigned long type; + }; + + ////////////////////////// + + template + struct pack + { + enum {value = (n + 1) * 2 + (Overflow ? 1 : 0)}; + }; + + template + struct unpack + { + enum {value = (m / 2) - 1}; + enum {overflow = (m % 2 == 1)}; + }; + + //////////////////////////////// + + template= 0x3fffffff)> + struct encode_size_t : push_back< + V, + boost::mpl::size_t::value> + > + {}; + + template + struct encode_size_t : push_back::value> >::type, + boost::mpl::size_t + > + {}; + + template + struct encode_integral : encode_size_t< V, (typename get_unsigned::type)n > + {}; + + /////////////////////////// + + template + struct decode_size_t; + + template + struct decode_size_t + { + enum {value = n}; + typedef Iter iter; + }; + + template + struct decode_size_t + { + enum {m = Iter::type::value}; + + enum {value = (size_t)m * 0x3ffffffe + n}; + typedef typename Iter::next iter; + }; + + template + struct decode_integral + { + enum {m = Iter::type::value}; + + enum {n = unpack::value}; + + enum {overflow = unpack::overflow}; + + typedef typename Iter::next nextpos; + + static const T value = (T)(size_t)decode_size_t::value; + + typedef typename decode_size_t::iter iter; + }; + +}}//namespace + +#endif//BOOST_TYPEOF_INT_ENCODING_HPP_INCLUDED diff --git a/include/boost/typeof/integral_template_param.hpp b/include/boost/typeof/integral_template_param.hpp new file mode 100755 index 0000000..0a6e503 --- /dev/null +++ b/include/boost/typeof/integral_template_param.hpp @@ -0,0 +1,80 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED +#define BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED + +#define BOOST_TYPEOF_unsigned (unsigned) +#define BOOST_TYPEOF_signed (signed) + +#define char_BOOST_TYPEOF (char) +#define short_BOOST_TYPEOF (short) +#define int_BOOST_TYPEOF (int) +#define long_BOOST_TYPEOF (long) + +#define BOOST_TYPEOF_char_BOOST_TYPEOF (char) +#define BOOST_TYPEOF_short_BOOST_TYPEOF (short) +#define BOOST_TYPEOF_int_BOOST_TYPEOF (int) +#define BOOST_TYPEOF_long_BOOST_TYPEOF (long) +#define BOOST_TYPEOF_bool_BOOST_TYPEOF (bool) +#define BOOST_TYPEOF_unsigned_BOOST_TYPEOF (unsigned) +#define BOOST_TYPEOF_size_t_BOOST_TYPEOF (size_t) + +#define BOOST_TYPEOF_MAKE_OBJ_char BOOST_TYPEOF_INTEGRAL_PARAM(char) +#define BOOST_TYPEOF_MAKE_OBJ_short BOOST_TYPEOF_INTEGRAL_PARAM(short) +#define BOOST_TYPEOF_MAKE_OBJ_int BOOST_TYPEOF_INTEGRAL_PARAM(int) +#define BOOST_TYPEOF_MAKE_OBJ_long BOOST_TYPEOF_INTEGRAL_PARAM(long) +#define BOOST_TYPEOF_MAKE_OBJ_bool BOOST_TYPEOF_INTEGRAL_PARAM(bool) +#define BOOST_TYPEOF_MAKE_OBJ_unsigned BOOST_TYPEOF_INTEGRAL_PARAM(unsigned) +#define BOOST_TYPEOF_MAKE_OBJ_size_t BOOST_TYPEOF_INTEGRAL_PARAM(size_t) +#define BOOST_TYPEOF_MAKE_OBJ_unsignedchar BOOST_TYPEOF_INTEGRAL_PARAM(unsigned char) +#define BOOST_TYPEOF_MAKE_OBJ_unsignedshort BOOST_TYPEOF_INTEGRAL_PARAM(unsigned short) +#define BOOST_TYPEOF_MAKE_OBJ_unsignedint BOOST_TYPEOF_INTEGRAL_PARAM(unsigned int) +#define BOOST_TYPEOF_MAKE_OBJ_unsignedlong BOOST_TYPEOF_INTEGRAL_PARAM(unsigned long) +#define BOOST_TYPEOF_MAKE_OBJ_signedchar BOOST_TYPEOF_INTEGRAL_PARAM(signed char) +#define BOOST_TYPEOF_MAKE_OBJ_signedshort BOOST_TYPEOF_INTEGRAL_PARAM(signed short) +#define BOOST_TYPEOF_MAKE_OBJ_signedint BOOST_TYPEOF_INTEGRAL_PARAM(signed int) +#define BOOST_TYPEOF_MAKE_OBJ_signedlong BOOST_TYPEOF_INTEGRAL_PARAM(signed long) +#define BOOST_TYPEOF_MAKE_OBJ_integral(x) BOOST_TYPEOF_INTEGRAL_PARAM(x) + +#define BOOST_TYPEOF_INTEGRAL(X) integral(X) BOOST_TYPEOF_EAT +#define BOOST_TYPEOF_EAT_BOOST_TYPEOF +#define BOOST_TYPEOF_integral(X) (integral(X)) + +#define BOOST_TYPEOF_INTEGRAL_PARAM(Type)\ + (INTEGRAL_PARAM)\ + (Type) + +#define BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param)\ + BOOST_PP_SEQ_ELEM(1, Param) + +#define BOOST_TYPEOF_INTEGRAL_PARAM_EXPANDTYPE(Param)\ + BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param) + +// INTEGRAL_PARAM "virtual functions" implementation + +#define BOOST_TYPEOF_INTEGRAL_PARAM_ENCODE(This, n)\ + typedef typename encode_integral<\ + BOOST_PP_CAT(V, n),\ + BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This),\ + BOOST_PP_CAT(P, n)\ + >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); + +#define BOOST_TYPEOF_INTEGRAL_PARAM_DECODE(This, n)\ + typedef decode_integral BOOST_PP_CAT(d, n);\ + static const BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This) BOOST_PP_CAT(P, n) = BOOST_PP_CAT(d, n)::value;\ + typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); + +#define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER(Param)\ + (BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param))0 + +#define BOOST_TYPEOF_INTEGRAL_PARAM_DECLARATION_TYPE(Param)\ + BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param) + +#define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER_TYPES(Param, n)\ + BOOST_PP_CAT(T,n) + +#define BOOST_TYPEOF_INTEGRAL_PARAM_ISTEMPLATE 0 + +#endif//BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED diff --git a/include/boost/typeof/limit_size.hpp b/include/boost/typeof/limit_size.hpp new file mode 100755 index 0000000..43c3c7c --- /dev/null +++ b/include/boost/typeof/limit_size.hpp @@ -0,0 +1,35 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_LIMIT_SIZE_HPP_INCLUDED +#define BOOST_TYPEOF_LIMIT_SIZE_HPP_INCLUDED + +#include "boost/mpl/vector.hpp" +#include "boost/mpl/aux_/config/ctps.hpp" +#include "boost/preprocessor/iterate.hpp" +#include "boost/preprocessor/if.hpp" +#include "boost/config.hpp" + +#ifndef BOOST_TYPEOF_LIMIT_SIZE +#define BOOST_TYPEOF_LIMIT_SIZE 50 +#endif//BOOST_TYPEOF_LIMIT_SIZE + +#if (BOOST_TYPEOF_LIMIT_SIZE > BOOST_MPL_LIMIT_VECTOR_SIZE) + +namespace boost +{ + namespace mpl + { + #define BOOST_PP_ITERATION_PARAMS_1 (3,( \ + BOOST_PP_INC(BOOST_MPL_LIMIT_VECTOR_SIZE), \ + BOOST_TYPEOF_LIMIT_SIZE, \ + "boost/mpl/vector/aux_/numbered.hpp")) + + #include BOOST_PP_ITERATE() + } +} + +#endif//BOOST_TYPEOF_LIMIT_SIZE > BOOST_MPL_LIMIT_VECTOR_SIZE + +#endif//BOOST_TYPEOF_LIMIT_SIZE_HPP_INCLUDED diff --git a/include/boost/typeof/lvalue_typeof.hpp b/include/boost/typeof/lvalue_typeof.hpp new file mode 100755 index 0000000..9b9f778 --- /dev/null +++ b/include/boost/typeof/lvalue_typeof.hpp @@ -0,0 +1,111 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED +#define BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED + +#include + +namespace boost +{ + namespace type_of + { + enum + { + RVALUE = 1, + LVALUE, + CONST_LVALUE + }; + + char(*classify_expression(...))[ + RVALUE + ]; + + template + char(*classify_expression(T&))[ + is_const::value ? CONST_LVALUE : LVALUE + ]; +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + template struct decorate_type + { + typedef T type; + }; + template struct decorate_type + { + typedef T& type; + }; + template struct decorate_type + { + typedef const T& type; + }; +#else + template + struct decorate_type_impl { + template + struct inner { + typedef T type; + }; + }; + template<> + struct decorate_type_impl { + template + struct inner { + typedef T& type; + }; + }; + + template<> + struct decorate_type_impl { + template + struct inner { + typedef T const& type; + }; + }; + + template struct decorate_type + { + typedef decorate_type_impl::inner::type type; + }; +#endif + } +} + + +// Since this is always a type, +// just add "typename" when using in templates + +#ifndef BOOST_TYPEOF_COMPLIANT + +#define BOOST_LVALUE_TYPEOF(expr) \ + boost::type_of::decorate_type< \ + BOOST_TYPEOF(expr), \ + sizeof(*boost::type_of::classify_expression(expr)) \ + >::type + +#else //BOOST_TYPEOF_COMPLIANT + +#include + +namespace boost { namespace type_of { + + template + struct decorate_decode_begin + { + typedef typename decorate_type< + typename decode_begin::type, + n + >::type type; + }; +}} + +#define BOOST_LVALUE_TYPEOF(expr) \ + boost::type_of::decorate_decode_begin< \ + BOOST_TYPEOF_ENCODED_VECTOR(expr), \ + sizeof(*boost::type_of::classify_expression(expr)) \ + >::type + +#endif + +#endif//BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED \ No newline at end of file diff --git a/include/boost/typeof/message.hpp b/include/boost/typeof/message.hpp new file mode 100755 index 0000000..1471ef3 --- /dev/null +++ b/include/boost/typeof/message.hpp @@ -0,0 +1,8 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#if defined(_MSC_VER) && !defined BOOST_TYPEOF_SILENT +# pragma message(BOOST_TYPEOF_TEXT) +#endif +#undef BOOST_TYPEOF_TEXT diff --git a/include/boost/typeof/modifiers.hpp b/include/boost/typeof/modifiers.hpp new file mode 100755 index 0000000..45c806d --- /dev/null +++ b/include/boost/typeof/modifiers.hpp @@ -0,0 +1,91 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED +#define BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED + +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +// modifiers + +#define BOOST_TYPEOF_modifier_support(ID, Fun)\ + template struct encode_type_impl\ + {\ + typedef\ + typename encode_type<\ + typename push_back<\ + V\ + , mpl::size_t >::type\ + , T>::type\ + type;\ + };\ + template struct decode_type_impl, Iter>\ + {\ + typedef decode_type d1;\ + typedef Fun(typename d1::type) type;\ + typedef typename d1::iter iter;\ + } + +#define BOOST_TYPEOF_const_fun(T) const T +#define BOOST_TYPEOF_volatile_fun(T) volatile T +#define BOOST_TYPEOF_volatile_const_fun(T) volatile const T +#define BOOST_TYPEOF_pointer_fun(T) T* +#define BOOST_TYPEOF_reference_fun(T) T& + +namespace boost{namespace type_of{namespace{ + + BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_const_fun); + BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_volatile_fun); + BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_volatile_const_fun); + BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_pointer_fun); + BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_reference_fun); + +}}} + +#undef BOOST_TYPEOF_modifier_support +#undef BOOST_TYPEOF_const_fun +#undef BOOST_TYPEOF_volatile_fun +#undef BOOST_TYPEOF_volatile_const_fun +#undef BOOST_TYPEOF_pointer_fun +#undef BOOST_TYPEOF_reference_fun + +// arrays + +#define BOOST_TYPEOF_array_support(ID, Qualifier)\ + template\ + struct encode_type_impl\ + {\ + typedef\ + typename encode_type<\ + typename push_back<\ + typename push_back<\ + V\ + , mpl::size_t >::type\ + , mpl::size_t >::type\ + , T>::type\ + type;\ + };\ + template\ + struct decode_type_impl, Iter>\ + {\ + enum{n = Iter::type::value};\ + typedef decode_type d;\ + typedef typename d::type Qualifier type[n];\ + typedef typename d::iter iter;\ + } + +namespace boost{namespace type_of{namespace{ + + BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_EMPTY()); + BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), const); + BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), volatile); + BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), volatile const); + +}}} + +#undef BOOST_TYPEOF_array_support + +#endif//BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp new file mode 100755 index 0000000..1dcd9c4 --- /dev/null +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -0,0 +1,156 @@ + +// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com +// Copyright (C) 2005 Peder Holt + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED +# define BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED + +# include +# include + +namespace boost +{ + namespace type_of + { + + //Compile time constant code +# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) && defined(_MSC_EXTENSIONS) + template struct the_counter; + + template + struct encode_counter + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=N); + typedef the_counter type; + } + } + } + } + } + }; + +# define BOOST_TYPEOF_INDEX(T) (encode_counter::count) +# define BOOST_TYPEOF_NEXT_INDEX(next) +# else + template struct encode_counter : encode_counter {}; + template<> struct encode_counter<0> {}; + + //Need to default to a larger value than 4, as due to MSVC's ETI errors. (sizeof(int)==4) + char (*encode_index(...))[5]; + +# define BOOST_TYPEOF_INDEX(T) (sizeof(*boost::type_of::encode_index((boost::type_of::encode_counter<1005>*)0))) +# define BOOST_TYPEOF_NEXT_INDEX(next) friend char (*encode_index(encode_counter*))[next]; +# endif + + //Typeof code + +# if BOOST_WORKAROUND(BOOST_MSVC,==1300) + template + struct msvc_typeof_base + { + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_typeof : msvc_typeof_base + { + template<> + struct id2type_impl + { + typedef T type; + }; + }; +# else + template + struct msvc_typeof_base + { + + struct id2type; + }; + + template + struct msvc_typeof : msvc_typeof_base + { + struct msvc_typeof_base::id2type // This uses nice VC6-VC7 bugfeature + { + typedef T type; + }; + }; +# endif + template + struct msvc_typeid_wrapper { + typedef typename msvc_typeof_base::id2type id2type; + typedef typename id2type::type type; + }; + //Workaround for ETI-bug for VC6 and VC7 + template<> + struct msvc_typeid_wrapper<1> { + typedef msvc_typeid_wrapper<1> type; + }; + //Workaround for ETI-bug for VC7.1 + template<> + struct msvc_typeid_wrapper<4> { + typedef msvc_typeid_wrapper<4> type; + }; + + //Tie it all together + template + struct encode_type + { + //Get the next available compile time constants index + BOOST_STATIC_CONSTANT(unsigned,value=BOOST_TYPEOF_INDEX(T)); + //Instantiate the template + typedef typename msvc_typeof::id2type type; + //Set the next compile time constants index + BOOST_STATIC_CONSTANT(unsigned,next=value+1); + //Increment the compile time constant (only needed when extensions are not active + BOOST_TYPEOF_NEXT_INDEX(next); + }; + + template + char (*encode_start(T const&))[encode_type::value]; + } +} + +# define BOOST_TYPEOF(expr) \ + boost::type_of::msvc_typeid_wrapper::type + +# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr) + +#endif//BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED diff --git a/include/boost/typeof/pointers_data_members.hpp b/include/boost/typeof/pointers_data_members.hpp new file mode 100755 index 0000000..ca6f349 --- /dev/null +++ b/include/boost/typeof/pointers_data_members.hpp @@ -0,0 +1,44 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED +#define BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +namespace boost +{ + namespace type_of + { + namespace + { + enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; + + template + struct encode_type_impl + { + typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type; + }; + + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(2) + + template struct workaround{ + typedef p0 T::* type; + }; + + typedef typename workaround::type type; + typedef iter2 iter; + }; + } + } +} + +#endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED diff --git a/include/boost/typeof/register_functions.hpp b/include/boost/typeof/register_functions.hpp new file mode 100755 index 0000000..0f749d8 --- /dev/null +++ b/include/boost/typeof/register_functions.hpp @@ -0,0 +1,45 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED +#define BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifndef BOOST_TYPEOF_LIMIT_FUNCTION_ARITY +#define BOOST_TYPEOF_LIMIT_FUNCTION_ARITY 10 +#endif + +enum +{ + FUN_ID = BOOST_TYPEOF_UNIQUE_ID(), + FUN_PTR_ID = FUN_ID + 1 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY), + FUN_REF_ID = FUN_ID + 2 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY), + MEM_FUN_ID = FUN_ID + 3 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY), + CONST_MEM_FUN_ID = FUN_ID + 4 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY), + VOLATILE_MEM_FUN_ID = FUN_ID + 5 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY), + VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) +}; + +namespace boost +{ + namespace type_of + { + # define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) + # define BOOST_PP_FILENAME_1 + # include BOOST_PP_ITERATE() + } +} + +#endif//BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED diff --git a/include/boost/typeof/register_functions_iterate.hpp b/include/boost/typeof/register_functions_iterate.hpp new file mode 100755 index 0000000..410be18 --- /dev/null +++ b/include/boost/typeof/register_functions_iterate.hpp @@ -0,0 +1,84 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include + +#define n BOOST_PP_ITERATION() + +namespace +{ + // function pointers + + template + struct encode_type_impl + { + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type; + }; + + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) + typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p)); + typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; + }; + + // function references + + template + struct encode_type_impl + { + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type; + }; + + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) + typedef BOOST_PP_CAT(p, n)(&type)(BOOST_PP_ENUM_PARAMS(n, p)); + typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; + }; + + // functions + + template + struct encode_type_impl + { + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type; + }; + + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) + typedef BOOST_PP_CAT(p, n)(type)(BOOST_PP_ENUM_PARAMS(n, p)); + typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; + }; + + // member functions + + #define BOOST_TYPEOF_qualifier + #define BOOST_TYPEOF_id MEM_FUN_ID + #include + + #define BOOST_TYPEOF_qualifier const + #define BOOST_TYPEOF_id CONST_MEM_FUN_ID + #include + + #define BOOST_TYPEOF_qualifier volatile + #define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID + #include + + #define BOOST_TYPEOF_qualifier volatile const + #define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID + #include +} + +#undef n diff --git a/include/boost/typeof/register_fundamental.hpp b/include/boost/typeof/register_fundamental.hpp new file mode 100755 index 0000000..65f4ab8 --- /dev/null +++ b/include/boost/typeof/register_fundamental.hpp @@ -0,0 +1,64 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Copyright (C) 2004 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_REGISTER_FUNDAMENTAL_HPP_INCLUDED +#define BOOST_TYPEOF_REGISTER_FUNDAMENTAL_HPP_INCLUDED + +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(unsigned char) +BOOST_TYPEOF_REGISTER_TYPE(unsigned short) +BOOST_TYPEOF_REGISTER_TYPE(unsigned int) +BOOST_TYPEOF_REGISTER_TYPE(unsigned long) + +BOOST_TYPEOF_REGISTER_TYPE(signed char) +BOOST_TYPEOF_REGISTER_TYPE(signed short) +BOOST_TYPEOF_REGISTER_TYPE(signed int) +BOOST_TYPEOF_REGISTER_TYPE(signed long) + +BOOST_TYPEOF_REGISTER_TYPE(bool) +BOOST_TYPEOF_REGISTER_TYPE(char) + +BOOST_TYPEOF_REGISTER_TYPE(float) +BOOST_TYPEOF_REGISTER_TYPE(double) +BOOST_TYPEOF_REGISTER_TYPE(long double) + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +// If the following line fails to compile and you're using the Intel +// compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php, +// and define BOOST_NO_INTRINSIC_WCHAR_T on the command line. +BOOST_TYPEOF_REGISTER_TYPE(wchar_t) +#endif + +#if (defined(BOOST_MSVC) && (BOOST_MSVC == 1200)) \ + || (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ + || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER == 1200)) +BOOST_TYPEOF_REGISTER_TYPE(unsigned __int8) +BOOST_TYPEOF_REGISTER_TYPE(__int8) +BOOST_TYPEOF_REGISTER_TYPE(unsigned __int16) +BOOST_TYPEOF_REGISTER_TYPE(__int16) +BOOST_TYPEOF_REGISTER_TYPE(unsigned __int32) +BOOST_TYPEOF_REGISTER_TYPE(__int32) +#ifdef __BORLANDC__ +BOOST_TYPEOF_REGISTER_TYPE(unsigned __int64) +BOOST_TYPEOF_REGISTER_TYPE(__int64) +#endif +#endif + +# if defined(BOOST_HAS_LONG_LONG) +BOOST_TYPEOF_REGISTER_TYPE(::boost::ulong_long_type) +BOOST_TYPEOF_REGISTER_TYPE(::boost::long_long_type) +#elif defined(BOOST_HAS_MS_INT64) +BOOST_TYPEOF_REGISTER_TYPE(unsigned __int64) +BOOST_TYPEOF_REGISTER_TYPE(__int64) +#endif + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TYPE(void) +#endif + +#endif//BOOST_TYPEOF_REGISTER_FUNDAMENTAL_HPP_INCLUDED diff --git a/include/boost/typeof/register_mem_functions.hpp b/include/boost/typeof/register_mem_functions.hpp new file mode 100755 index 0000000..0959303 --- /dev/null +++ b/include/boost/typeof/register_mem_functions.hpp @@ -0,0 +1,32 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#include + +// member functions + +template +struct encode_type_impl +{ + typedef R BOOST_PP_CAT(P, n); + typedef T BOOST_PP_CAT(P, BOOST_PP_INC(n)); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_ADD(n, 2), BOOST_TYPEOF_id + n) type; +}; + +template +struct decode_type_impl, Iter> +{ + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_ADD(n, 2)) + template struct workaround{ + typedef BOOST_PP_CAT(p, n)(T::*type)(BOOST_PP_ENUM_PARAMS(n, p)) BOOST_TYPEOF_qualifier; + }; + typedef typename workaround::type type; + typedef BOOST_PP_CAT(iter, BOOST_PP_ADD(n, 2)) iter; +}; + +// undef parameters + +#undef BOOST_TYPEOF_id +#undef BOOST_TYPEOF_qualifier diff --git a/include/boost/typeof/std/bitset.hpp b/include/boost/typeof/std/bitset.hpp new file mode 100755 index 0000000..014a114 --- /dev/null +++ b/include/boost/typeof/std/bitset.hpp @@ -0,0 +1,17 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_bitset_hpp_INCLUDED +#define BOOST_TYPEOF_STD_bitset_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::bitset, (size_t)) + +#endif//BOOST_TYPEOF_STD_bitset_hpp_INCLUDED diff --git a/include/boost/typeof/std/complex.hpp b/include/boost/typeof/std/complex.hpp new file mode 100755 index 0000000..85c87a0 --- /dev/null +++ b/include/boost/typeof/std/complex.hpp @@ -0,0 +1,17 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_complex_hpp_INCLUDED +#define BOOST_TYPEOF_STD_complex_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::complex, 1) + +#endif//BOOST_TYPEOF_STD_complex_hpp_INCLUDED diff --git a/include/boost/typeof/std/deque.hpp b/include/boost/typeof/std/deque.hpp new file mode 100755 index 0000000..87f5f12 --- /dev/null +++ b/include/boost/typeof/std/deque.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_deque_hpp_INCLUDED +#define BOOST_TYPEOF_STD_deque_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::deque, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::deque, 2) + +#endif//BOOST_TYPEOF_STD_deque_hpp_INCLUDED diff --git a/include/boost/typeof/std/fstream.hpp b/include/boost/typeof/std/fstream.hpp new file mode 100755 index 0000000..903b398 --- /dev/null +++ b/include/boost/typeof/std/fstream.hpp @@ -0,0 +1,39 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_fstream_hpp_INCLUDED +#define BOOST_TYPEOF_STD_fstream_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_filebuf, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_filebuf, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ifstream, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ifstream, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ofstream, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ofstream, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_fstream, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_fstream, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TYPE(std::filebuf) +BOOST_TYPEOF_REGISTER_TYPE(std::ifstream) +BOOST_TYPEOF_REGISTER_TYPE(std::ofstream) +BOOST_TYPEOF_REGISTER_TYPE(std::fstream) +#endif//BOOST_TYPEOF_COMPLIANT + +#endif//BOOST_TYPEOF_STD_fstream_hpp_INCLUDED diff --git a/include/boost/typeof/std/functional.hpp b/include/boost/typeof/std/functional.hpp new file mode 100755 index 0000000..3e540f6 --- /dev/null +++ b/include/boost/typeof/std/functional.hpp @@ -0,0 +1,49 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_functional_hpp_INCLUDED +#define BOOST_TYPEOF_STD_functional_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::unary_function, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::binary_function, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::plus, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::minus, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiplies, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::divides, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::modulus, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::negate, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::equal_to, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::not_equal_to, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::greater, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::less, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::greater_equal, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::less_equal, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_and, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_or, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_not, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::unary_negate, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::binary_negate, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::binder1st, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::binder2nd, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::pointer_to_unary_function, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::pointer_to_binary_function, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun_t, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun1_t, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun_ref_t, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun1_ref_t, 3) +#if !BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun_t, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun1_t, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun_ref_t, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun1_ref_t, 3) +#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) + +#endif//BOOST_TYPEOF_STD_functional_hpp_INCLUDED diff --git a/include/boost/typeof/std/iostream.hpp b/include/boost/typeof/std/iostream.hpp new file mode 100755 index 0000000..5d879de --- /dev/null +++ b/include/boost/typeof/std/iostream.hpp @@ -0,0 +1,22 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_iostream_hpp_INCLUDED +#define BOOST_TYPEOF_STD_iostream_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::fpos, 1) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ios, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ios, 2) + +#endif//BOOST_TYPEOF_STD_iostream_hpp_INCLUDED diff --git a/include/boost/typeof/std/istream.hpp b/include/boost/typeof/std/istream.hpp new file mode 100755 index 0000000..a344d1d --- /dev/null +++ b/include/boost/typeof/std/istream.hpp @@ -0,0 +1,29 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_istream_hpp_INCLUDED +#define BOOST_TYPEOF_STD_istream_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istream, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istream, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_iostream, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_iostream, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TYPE(std::istream) +BOOST_TYPEOF_REGISTER_TYPE(std::iostream) +#endif//BOOST_TYPEOF_COMPLIANT + +#endif//BOOST_TYPEOF_STD_istream_hpp_INCLUDED diff --git a/include/boost/typeof/std/iterator.hpp b/include/boost/typeof/std/iterator.hpp new file mode 100755 index 0000000..c46601d --- /dev/null +++ b/include/boost/typeof/std/iterator.hpp @@ -0,0 +1,76 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_iterator_hpp_INCLUDED +#define BOOST_TYPEOF_STD_iterator_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator_traits, 1) +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 3) +#else +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 4) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 5) +#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +BOOST_TYPEOF_REGISTER_TYPE(std::input_iterator_tag) +BOOST_TYPEOF_REGISTER_TYPE(std::output_iterator_tag) +BOOST_TYPEOF_REGISTER_TYPE(std::forward_iterator_tag) +BOOST_TYPEOF_REGISTER_TYPE(std::bidirectional_iterator_tag) +BOOST_TYPEOF_REGISTER_TYPE(std::random_access_iterator_tag) +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 4) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 5) +#else +BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 1) +#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::back_insert_iterator, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::front_insert_iterator, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::insert_iterator, 1) +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 3) +#else +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 3) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 4) +#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostream_iterator, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostream_iterator, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostream_iterator, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istreambuf_iterator, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::istreambuf_iterator, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostreambuf_iterator, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostreambuf_iterator, 2) + +#endif//BOOST_TYPEOF_STD_iterator_hpp_INCLUDED diff --git a/include/boost/typeof/std/list.hpp b/include/boost/typeof/std/list.hpp new file mode 100755 index 0000000..e4f72fb --- /dev/null +++ b/include/boost/typeof/std/list.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_list_hpp_INCLUDED +#define BOOST_TYPEOF_STD_list_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::list, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::list, 2) + +#endif//BOOST_TYPEOF_STD_list_hpp_INCLUDED diff --git a/include/boost/typeof/std/locale.hpp b/include/boost/typeof/std/locale.hpp new file mode 100755 index 0000000..292c8f6 --- /dev/null +++ b/include/boost/typeof/std/locale.hpp @@ -0,0 +1,42 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_locale_hpp_INCLUDED +#define BOOST_TYPEOF_STD_locale_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(std::locale) +BOOST_TYPEOF_REGISTER_TYPE(std::ctype_base) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ctype, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::ctype_byname, 1) +BOOST_TYPEOF_REGISTER_TYPE(std::codecvt_base) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::codecvt, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::codecvt_byname, 3) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::num_get, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::num_put, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::numpunct, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::numpunct_byname, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::collate, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::collate_byname, 1) +BOOST_TYPEOF_REGISTER_TYPE(std::time_base) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_get, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_get_byname, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_put, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_put_byname, 2) +BOOST_TYPEOF_REGISTER_TYPE(std::money_base) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::money_get, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::money_put, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::moneypunct, (class)(bool)) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::moneypunct_byname, (class)(bool)) +BOOST_TYPEOF_REGISTER_TYPE(std::messages_base) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::messages, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::messages_byname, 1) + +#endif//BOOST_TYPEOF_STD_locale_hpp_INCLUDED diff --git a/include/boost/typeof/std/map.hpp b/include/boost/typeof/std/map.hpp new file mode 100755 index 0000000..076217a --- /dev/null +++ b/include/boost/typeof/std/map.hpp @@ -0,0 +1,29 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_map_hpp_INCLUDED +#define BOOST_TYPEOF_STD_map_hpp_INCLUDED + +#include +#include +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::map, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::map, 3) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::map, 4) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multimap, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multimap, 3) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multimap, 4) + +#endif//BOOST_TYPEOF_STD_map_hpp_INCLUDED diff --git a/include/boost/typeof/std/memory.hpp b/include/boost/typeof/std/memory.hpp new file mode 100755 index 0000000..cd368fa --- /dev/null +++ b/include/boost/typeof/std/memory.hpp @@ -0,0 +1,19 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_memory_hpp_INCLUDED +#define BOOST_TYPEOF_STD_memory_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::allocator, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::raw_storage_iterator, 2) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::auto_ptr, 1) + +#endif//BOOST_TYPEOF_STD_memory_hpp_INCLUDED diff --git a/include/boost/typeof/std/ostream.hpp b/include/boost/typeof/std/ostream.hpp new file mode 100755 index 0000000..831039c --- /dev/null +++ b/include/boost/typeof/std/ostream.hpp @@ -0,0 +1,24 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_ostream_hpp_INCLUDED +#define BOOST_TYPEOF_STD_ostream_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostream, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostream, 2) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TYPE(std::ostream) +#endif//BOOST_TYPEOF_COMPLIANT + +#endif//BOOST_TYPEOF_STD_ostream_hpp_INCLUDED diff --git a/include/boost/typeof/std/queue.hpp b/include/boost/typeof/std/queue.hpp new file mode 100755 index 0000000..8ea967f --- /dev/null +++ b/include/boost/typeof/std/queue.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_queue_hpp_INCLUDED +#define BOOST_TYPEOF_STD_queue_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::queue, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::queue, 2) + +#endif//BOOST_TYPEOF_STD_queue_hpp_INCLUDED diff --git a/include/boost/typeof/std/set.hpp b/include/boost/typeof/std/set.hpp new file mode 100755 index 0000000..a6f4bb0 --- /dev/null +++ b/include/boost/typeof/std/set.hpp @@ -0,0 +1,28 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_set_hpp_INCLUDED +#define BOOST_TYPEOF_STD_set_hpp_INCLUDED + +#include +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiset, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiset, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiset, 3) + +#endif//BOOST_TYPEOF_STD_set_hpp_INCLUDED diff --git a/include/boost/typeof/std/sstream.hpp b/include/boost/typeof/std/sstream.hpp new file mode 100755 index 0000000..5d2e7b1 --- /dev/null +++ b/include/boost/typeof/std/sstream.hpp @@ -0,0 +1,44 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_sstream_hpp_INCLUDED +#define BOOST_TYPEOF_STD_sstream_hpp_INCLUDED + +#include +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringbuf, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringbuf, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringbuf, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istringstream, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istringstream, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istringstream, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostringstream, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostringstream, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostringstream, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringstream, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringstream, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringstream, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TYPE(std::stringbuf) +BOOST_TYPEOF_REGISTER_TYPE(std::istringstream) +BOOST_TYPEOF_REGISTER_TYPE(std::ostringstream) +BOOST_TYPEOF_REGISTER_TYPE(std::stringstream) +#endif//BOOST_TYPEOF_COMPLIANT + +#endif//BOOST_TYPEOF_STD_sstream_hpp_INCLUDED diff --git a/include/boost/typeof/std/stack.hpp b/include/boost/typeof/std/stack.hpp new file mode 100755 index 0000000..1a15a1b --- /dev/null +++ b/include/boost/typeof/std/stack.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_stack_hpp_INCLUDED +#define BOOST_TYPEOF_STD_stack_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::stack, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::stack, 2) + +#endif//BOOST_TYPEOF_STD_stack_hpp_INCLUDED diff --git a/include/boost/typeof/std/streambuf.hpp b/include/boost/typeof/std/streambuf.hpp new file mode 100755 index 0000000..307d047 --- /dev/null +++ b/include/boost/typeof/std/streambuf.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_streambuf_hpp_INCLUDED +#define BOOST_TYPEOF_STD_streambuf_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_streambuf, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_streambuf, 2) + +#endif//BOOST_TYPEOF_STD_streambuf_hpp_INCLUDED diff --git a/include/boost/typeof/std/string.hpp b/include/boost/typeof/std/string.hpp new file mode 100755 index 0000000..dd509e4 --- /dev/null +++ b/include/boost/typeof/std/string.hpp @@ -0,0 +1,26 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_string_hpp_INCLUDED +#define BOOST_TYPEOF_STD_string_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::char_traits, 1) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 2) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 3) +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TYPE(std::string) +#endif//BOOST_TYPEOF_COMPLIANT + +#endif//BOOST_TYPEOF_STD_string_hpp_INCLUDED diff --git a/include/boost/typeof/std/utility.hpp b/include/boost/typeof/std/utility.hpp new file mode 100755 index 0000000..467e6c8 --- /dev/null +++ b/include/boost/typeof/std/utility.hpp @@ -0,0 +1,17 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_utility_hpp_INCLUDED +#define BOOST_TYPEOF_STD_utility_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::pair, 2) + +#endif//BOOST_TYPEOF_STD_utility_hpp_INCLUDED diff --git a/include/boost/typeof/std/valarray.hpp b/include/boost/typeof/std/valarray.hpp new file mode 100755 index 0000000..9a36ee8 --- /dev/null +++ b/include/boost/typeof/std/valarray.hpp @@ -0,0 +1,23 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_valarray_hpp_INCLUDED +#define BOOST_TYPEOF_STD_valarray_hpp_INCLUDED + +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(std::valarray, 1) +BOOST_TYPEOF_REGISTER_TYPE(std::slice) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::slice_array, 1) +BOOST_TYPEOF_REGISTER_TYPE(std::gslice) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::gslice_array, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::mask_array, 1) +BOOST_TYPEOF_REGISTER_TEMPLATE(std::indirect_array, 1) + +#endif//BOOST_TYPEOF_STD_valarray_hpp_INCLUDED diff --git a/include/boost/typeof/std/vector.hpp b/include/boost/typeof/std/vector.hpp new file mode 100755 index 0000000..1f28827 --- /dev/null +++ b/include/boost/typeof/std/vector.hpp @@ -0,0 +1,21 @@ +// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +// This is a generated file -- please do not modify by hand. + +#ifndef BOOST_TYPEOF_STD_vector_hpp_INCLUDED +#define BOOST_TYPEOF_STD_vector_hpp_INCLUDED + +#include +#include +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +#ifdef BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::vector, 1) +#endif//BOOST_TYPEOF_COMPLIANT +BOOST_TYPEOF_REGISTER_TEMPLATE(std::vector, 2) + +#endif//BOOST_TYPEOF_STD_vector_hpp_INCLUDED diff --git a/include/boost/typeof/template_encoding.hpp b/include/boost/typeof/template_encoding.hpp new file mode 100755 index 0000000..c623086 --- /dev/null +++ b/include/boost/typeof/template_encoding.hpp @@ -0,0 +1,148 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Copyright (C) 2005 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED +#define BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +// The template parameter description, entered by the user, +// is converted into a polymorphic "object" +// that is used to generate the code responsible for +// encoding/decoding the parameter, etc. + +// make sure to cat the sequence first, and only then add the prefix. +#define BOOST_TYPEOF_MAKE_OBJ(elem) BOOST_PP_CAT(\ + BOOST_TYPEOF_MAKE_OBJ,\ + BOOST_PP_SEQ_CAT((_) BOOST_TYPEOF_TO_SEQ(elem))\ + ) + +#define BOOST_TYPEOF_TO_SEQ(tokens) BOOST_TYPEOF_ ## tokens ## _BOOST_TYPEOF + +// BOOST_TYPEOF_REGISTER_TEMPLATE + +#define BOOST_TYPEOF_REGISTER_TEMPLATE(Name, Params)\ + BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(\ + Name,\ + BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TOSEQ(Params)),\ + BOOST_PP_SEQ_SIZE(BOOST_TYPEOF_TOSEQ(Params)),\ + BOOST_TYPEOF_UNIQUE_ID())\ + +#define BOOST_TYPEOF_OBJECT_MAKER(s, data, elem)\ + BOOST_TYPEOF_MAKE_OBJ(elem) + +#define BOOST_TYPEOF_MAKE_OBJS(Params)\ + BOOST_PP_SEQ_TRANSFORM(BOOST_TYPEOF_OBJECT_MAKER, ~, Params) + +// As suggested by Paul Mensonides: + +#define BOOST_TYPEOF_TOSEQ(x)\ + BOOST_PP_IIF(\ + BOOST_PP_IS_UNARY(x),\ + x BOOST_PP_TUPLE_EAT(3), BOOST_PP_REPEAT\ + )(x, BOOST_TYPEOF_TOSEQ_2, ~) + +#define BOOST_TYPEOF_TOSEQ_2(z, n, _) (class) + +// BOOST_TYPEOF_VIRTUAL + +#define BOOST_TYPEOF_CAT_4(a, b, c, d) BOOST_TYPEOF_CAT_4_I(a, b, c, d) +#define BOOST_TYPEOF_CAT_4_I(a, b, c, d) a ## b ## c ## d + +#define BOOST_TYPEOF_VIRTUAL(Fun, Obj)\ + BOOST_TYPEOF_CAT_4(BOOST_TYPEOF_, BOOST_PP_SEQ_HEAD(Obj), _, Fun) + +// BOOST_TYPEOF_SEQ_ENUM[_TRAILING][_1] +// Two versions provided due to reentrancy issue + +#define BOOST_TYPEOF_SEQ_EXPAND_ELEMENT(z,n,seq)\ + BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq))) + +#define BOOST_TYPEOF_SEQ_ENUM(seq,macro)\ + BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq)) + +#define BOOST_TYPEOF_SEQ_ENUM_TRAILING(seq,macro)\ + BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq)) + +#define BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1(z,n,seq)\ + BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq))) + +#define BOOST_TYPEOF_SEQ_ENUM_1(seq,macro)\ + BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq)) + +#define BOOST_TYPEOF_SEQ_ENUM_TRAILING_1(seq,macro)\ + BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq)) + +// + +#define BOOST_TYPEOF_PLACEHOLDER(z, n, elem)\ + BOOST_TYPEOF_VIRTUAL(PLACEHOLDER, elem)(elem) + +#define BOOST_TYPEOF_PLACEHOLDER_TYPES(z, n, elem)\ + BOOST_TYPEOF_VIRTUAL(PLACEHOLDER_TYPES, elem)(elem, n) + +#define BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM(r, data, n, elem)\ + BOOST_TYPEOF_VIRTUAL(ENCODE, elem)(elem, n) + +#define BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM(r, data, n, elem)\ + BOOST_TYPEOF_VIRTUAL(DECODE, elem)(elem, n) + +#define BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR(z, n, elem) \ + BOOST_TYPEOF_VIRTUAL(EXPANDTYPE, elem)(elem) BOOST_PP_CAT(P, n) + +#define BOOST_TYPEOF_REGISTER_DEFAULT_TEMPLATE_TYPE(Name,Params,ID)\ + Name< BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params), P) > + +//Since we are creating an internal decode struct, we need to use different template names, T instead of P. +#define BOOST_TYPEOF_REGISTER_DECODER_TYPE_PARAM_PAIR(z,n,elem) \ + BOOST_TYPEOF_VIRTUAL(EXPANDTYPE, elem)(elem) BOOST_PP_CAT(T, n) + +//Default template param decoding +#define BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE(Name,Params)\ + typedef Name type; + +//Branch the decoding +#define BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name,Params)\ + BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATES(Params),\ + BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE,\ + BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params) + +#define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\ + namespace boost{namespace type_of{namespace{\ + BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\ + template\ + struct encode_type_impl >\ + {\ + typedef typename push_back >::type V0;\ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM, ~, Params)\ + typedef BOOST_PP_CAT(V, Size) type;\ + };\ + template\ + struct decode_type_impl, Iter>\ + {\ + typedef Iter iter0;\ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM, ~, Params)\ + BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name, Params)\ + typedef BOOST_PP_CAT(iter, Size) iter;\ + };\ + }}} + +#endif//BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED diff --git a/include/boost/typeof/template_template_param.hpp b/include/boost/typeof/template_template_param.hpp new file mode 100755 index 0000000..b495106 --- /dev/null +++ b/include/boost/typeof/template_template_param.hpp @@ -0,0 +1,126 @@ +// Copyright (C) 2005 Peder Holt +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED +#define BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED + +#include +#include +#include + +#define BOOST_TYPEOF_MAKE_OBJ_template(x) BOOST_TYPEOF_TEMPLATE_PARAM(x) +#define BOOST_TYPEOF_TEMPLATE(X) template(X) BOOST_TYPEOF_EAT +#define BOOST_TYPEOF_template(X) (template(X)) + +#define BOOST_TYPEOF_TEMPLATE_PARAM(Params)\ + (TEMPLATE_PARAM)\ + (Params) + +#define BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(This)\ + BOOST_TYPEOF_TOSEQ(BOOST_PP_SEQ_ELEM(1, This)) + +//Encode / decode this +#define BOOST_TYPEOF_TEMPLATE_PARAM_ENCODE(This, n)\ + typedef typename encode_template\ + >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); + +#define BOOST_TYPEOF_TEMPLATE_PARAM_DECODE(This, n)\ + typedef decode_template< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ + typedef typename BOOST_PP_CAT(d, n)::type BOOST_PP_CAT(P, n);\ + typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter,BOOST_PP_INC(n)); + +// template class +#define BOOST_TYPEOF_TEMPLATE_PARAM_EXPANDTYPE(This) \ + template class + +#define BOOST_TYPEOF_TEMPLATE_PARAM_PLACEHOLDER(Param)\ + Nested_Template_Template_Arguments_Not_Supported + +//'template class' is reduced to 'class' +#define BOOST_TYPEOF_TEMPLATE_PARAM_DECLARATION_TYPE(Param) class + +// T3 +#define BOOST_TYPEOF_TEMPLATE_PARAM_PLACEHOLDER_TYPES(Param, n)\ + BOOST_PP_CAT(T,n) + +#define BOOST_TYPEOF_TEMPLATE_PARAM_ISTEMPLATE 1 + +//////////////////////////// +// move to encode_decode? + +namespace boost +{ + namespace type_of + { + namespace + { + template struct encode_template_impl; + template struct decode_template_impl; + } + template struct encode_template + : encode_template_impl + {}; + + template struct decode_template + : decode_template_impl + {}; + } +} + +//////////////////////////// +// move to template_encoding.hpp? + +//Template template registration +#define BOOST_TYPEOF_REGISTER_TYPE_FOR_TEMPLATE_TEMPLATE(Name,Params,ID)\ + template\ + struct encode_template_impl >\ + : push_back >\ + {\ + };\ + template struct decode_template_impl, Iter>\ + {\ + BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_TYPEDEF_INT_PN,_)\ + typedef Name type;\ + typedef Iter iter;\ + }; + +#define BOOST_TYPEOF_TYPEDEF_INT_PN(z,n,Params) typedef int BOOST_PP_CAT(P,n); + +#define BOOST_TYPEOF_REGISTER_NOTHING(Name,Params,ID) + +//Template template param decoding +#define BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE(Name,Params)\ + template\ + struct decode_params;\ + template\ + struct decode_params\ + {\ + typedef Name type;\ + };\ + typedef typename decode_params::type type; + +#define BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR(z,n,elem) \ + BOOST_TYPEOF_VIRTUAL(DECLARATION_TYPE, elem)(elem) BOOST_PP_CAT(T, n) + +// BOOST_TYPEOF_HAS_TEMPLATES +#define BOOST_TYPEOF_HAS_TEMPLATES(Params)\ + BOOST_PP_SEQ_FOLD_LEFT(BOOST_TYPEOF_HAS_TEMPLATES_OP, 0, Params) + +#define BOOST_TYPEOF_HAS_TEMPLATES_OP(s, state, elem)\ + BOOST_PP_OR(state, BOOST_TYPEOF_VIRTUAL(ISTEMPLATE, elem)) + +//Define template template arguments +#define BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name,Params,ID)\ + BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATES(Params),\ + BOOST_TYPEOF_REGISTER_NOTHING,\ + BOOST_TYPEOF_REGISTER_TYPE_FOR_TEMPLATE_TEMPLATE)(Name,Params,ID) + +#endif //BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED diff --git a/include/boost/typeof/type_encoding.hpp b/include/boost/typeof/type_encoding.hpp new file mode 100755 index 0000000..07e69f6 --- /dev/null +++ b/include/boost/typeof/type_encoding.hpp @@ -0,0 +1,24 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED +#define BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED + +#define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \ + \ + template struct encode_type_impl \ + : push_back > \ + {}; \ + template struct decode_type_impl, Iter> \ + { \ + typedef T type; \ + typedef Iter iter; \ + }; + +#define BOOST_TYPEOF_REGISTER_TYPE(Type) \ + namespace boost{namespace type_of{namespace{ \ + BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, BOOST_TYPEOF_UNIQUE_ID()) \ + }}} + +#endif//BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED diff --git a/include/boost/typeof/type_template_param.hpp b/include/boost/typeof/type_template_param.hpp new file mode 100755 index 0000000..34e063c --- /dev/null +++ b/include/boost/typeof/type_template_param.hpp @@ -0,0 +1,37 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED +#define BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED + +#define BOOST_TYPEOF_class_BOOST_TYPEOF (class) +#define BOOST_TYPEOF_typename_BOOST_TYPEOF (typename) + +#define BOOST_TYPEOF_MAKE_OBJ_class BOOST_TYPEOF_TYPE_PARAM +#define BOOST_TYPEOF_MAKE_OBJ_typename BOOST_TYPEOF_TYPE_PARAM + +#define BOOST_TYPEOF_TYPE_PARAM\ + (TYPE_PARAM) + +#define BOOST_TYPEOF_TYPE_PARAM_EXPANDTYPE(Param) class + +// TYPE_PARAM "virtual functions" implementation + +#define BOOST_TYPEOF_TYPE_PARAM_ENCODE(This, n)\ + typedef typename encode_type<\ + BOOST_PP_CAT(V, n),\ + BOOST_PP_CAT(P, n)\ + >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); + +#define BOOST_TYPEOF_TYPE_PARAM_DECODE(This, n)\ + typedef decode_type< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ + typedef typename BOOST_PP_CAT(d, n)::type BOOST_PP_CAT(P, n);\ + typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); + +#define BOOST_TYPEOF_TYPE_PARAM_PLACEHOLDER(Param) int +#define BOOST_TYPEOF_TYPE_PARAM_DECLARATION_TYPE(Param) class +#define BOOST_TYPEOF_TYPE_PARAM_PLACEHOLDER_TYPES(Param, n) BOOST_PP_CAT(T,n) +#define BOOST_TYPEOF_TYPE_PARAM_ISTEMPLATE 0 + +#endif//BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp new file mode 100755 index 0000000..4429a6c --- /dev/null +++ b/include/boost/typeof/typeof.hpp @@ -0,0 +1,89 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED +#define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED + +#include +#include +#include + +// implementation + +#include + +// BOOST_TYPEOF, BOOST_TYPEOF_TPL + +#if defined(BOOST_TYPEOF_NATIVE) && defined(BOOST_MSVC) +# define BOOST_TYPEOF_TEXT "using msvc 'native' imlementation" +# include +# include + +#elif defined(BOOST_TYPEOF_COMPLIANT) +# define BOOST_TYPEOF_TEXT "using compliant imlementation" +# include +# include + +#else//BOOST_TYPEOF_NATIVE + +# define BOOST_TYPEOF_TEXT "using native imlementation" +# include + +# if !defined BOOST_TYPEOF_KEYWORD +# define BOOST_TYPEOF_KEYWORD __typeof__ +# endif + + /* Native __typeof__ can accept either type or value. + Something like "int()" can be viewed either way, but + __typeof__ consideres it a type. We force it otherwise + to ensure consistensy with emulation */ + + namespace boost { namespace type_of { + template T& ensure_obj(const T&); + }} + +# define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr)) + +# define BOOST_TYPEOF_TPL BOOST_TYPEOF + +#endif + +// auto +#define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr +#define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr + +// lvalue typeof + +# include + +// type/template encoding + +#if defined(BOOST_TYPEOF_COMPLIANT) +# include +# include +#else //BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_REGISTER_TYPE(x) +# define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params) +#endif + +#define BOOST_TYPEOF_UNIQUE_ID()\ + BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__ + +#define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\ + + +// register stuff +#include + +#if defined(BOOST_TYPEOF_COMPLIANT) + +# include +# include +# include + +#else //BOOST_TYPEOF_NATIVE + +#endif + +#endif//BOOST_TYPEOF_TYPEOF_HPP_INCLUDED diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp new file mode 100755 index 0000000..873d0ed --- /dev/null +++ b/include/boost/typeof/typeof_impl.hpp @@ -0,0 +1,59 @@ +// Copyright (C) 2004, 2005 Arkadiy Vertleyb +// Copyright (C) 2005 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED +#define BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED + +#include +#include +#include +#include + +#define BOOST_TYPEOF_VECTOR(n) BOOST_PP_CAT(boost::type_of::vector, n) + +#define BOOST_TYPEOF_sizer_item(z, n, _)\ + char item ## n[V::item ## n ::value]; + +namespace boost { namespace type_of { + + template + struct sizer + { + // char item0[V::item0::value]; + // char item1[V::item1::value]; + // ... + + BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_sizer_item, ~) + }; + + template + sizer, T>::type> encode(const T&); +}} + +#undef BOOST_TYPEOF_sizer_item + +namespace boost { namespace type_of { + + template + struct decode_begin + { + typedef typename decode_type::type type; + }; +}} + +#define BOOST_TYPEOF_TYPEITEM(z, n, expr)\ + boost::mpl::size_t + +#define BOOST_TYPEOF_ENCODED_VECTOR(Expr) \ + BOOST_TYPEOF_VECTOR(BOOST_TYPEOF_LIMIT_SIZE)< \ + BOOST_PP_ENUM(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_TYPEITEM, Expr) \ + > + +#define BOOST_TYPEOF(Expr)\ + boost::type_of::decode_begin::type + +#define BOOST_TYPEOF_TPL typename BOOST_TYPEOF + +#endif//BOOST_TYPEOF_COMPLIANT_TYPEOF_IMPL_HPP_INCLUDED diff --git a/include/boost/typeof/vector.hpp b/include/boost/typeof/vector.hpp new file mode 100755 index 0000000..4731958 --- /dev/null +++ b/include/boost/typeof/vector.hpp @@ -0,0 +1,87 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Copyright (C) 2005 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_VECTOR_HPP_INCLUDED +#define BOOST_TYPEOF_VECTOR_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +#ifndef BOOST_TYPEOF_LIMIT_SIZE +# define BOOST_TYPEOF_LIMIT_SIZE 50 +#endif + +// iterator + +#define BOOST_TYPEOF_spec_iter(z, n, _)\ + template\ + struct v_iter >\ + {\ + typedef typename V::item ## n type;\ + typedef v_iter > next;\ + }; + +namespace boost{ namespace type_of{ + + template struct v_iter; // not defined + BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_spec_iter, ~) +}} + +#undef BOOST_TYPEOF_spec_iter + +// vector + +#define BOOST_TYPEOF_typedef_item(z, n, _)\ + typedef P ## n item ## n; + +#define BOOST_TYPEOF_typedef_fake_item(z, n, _)\ + typedef mpl::int_<1> item ## n; + +#define BOOST_TYPEOF_define_vector(z, n, _)\ + template\ + struct vector ## n\ + {\ + typedef v_iter > begin;\ + BOOST_PP_REPEAT(n, BOOST_TYPEOF_typedef_item, ~)\ + BOOST_PP_REPEAT_FROM_TO(n, BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_typedef_fake_item, ~)\ + }; + +namespace boost{ namespace type_of{ + + BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_TYPEOF_LIMIT_SIZE), BOOST_TYPEOF_define_vector, ~) +}} + +#undef BOOST_TYPEOF_typedef_item +#undef BOOST_TYPEOF_typedef_fake_item +#undef BOOST_TYPEOF_define_vector + +// push_back + +#define BOOST_TYPEOF_spec_push_back(z, n, _)\ + template\ + struct push_back, T>\ + {\ + typedef BOOST_PP_CAT(boost::type_of::vector, BOOST_PP_INC(n))<\ + BOOST_PP_ENUM_PARAMS(n, P) BOOST_PP_COMMA_IF(n) T\ + > type;\ + }; + +namespace boost{ namespace type_of{ + + template struct push_back; // not defined + BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_spec_push_back, ~) +}} + +#undef BOOST_TYPEOF_spec_push_back + +#endif//BOOST_TYPEOF_COMPLIANT_VECTOR_HPP_INCLUDED + + +