From 35874c8e32776da348340b3171db1e897100a0f3 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 21 Mar 2006 02:26:31 +0000 Subject: [PATCH 01/35] This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'. [SVN r33417] From c17f725e5f47394d4177134d925ef096d848de6a Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Thu, 23 Mar 2006 20:54:37 +0000 Subject: [PATCH 02/35] Merged doc fix for BOOST_TYPEOF_NESTED_TYPEDEF (removal of tabs in doc) from HEAD [SVN r33461] --- doc/typeof.qbk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index d396054..f0e5778 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -590,8 +590,8 @@ which takes care of `typename` inside the `typeof` expression. template struct result_of_conditional { - BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B()); - typedef typename nested::type type; + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B()); + typedef typename nested::type type; }; template From 041f9cfd248deceadcc0d75a4a47cdaee28fe776 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Wed, 29 Mar 2006 17:36:53 +0000 Subject: [PATCH 03/35] Merged typo in typeof doc from HEAD [SVN r33525] --- doc/typeof.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index f0e5778..4ae21f1 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -590,7 +590,7 @@ which takes care of `typename` inside the `typeof` expression. template struct result_of_conditional { - BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B()); + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B()) typedef typename nested::type type; }; From 97b9bda347cbdd3a259fbe37bac13b9eded08656 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sun, 23 Apr 2006 12:44:00 +0000 Subject: [PATCH 04/35] merged typeof doc id [SVN r33770] --- doc/typeof.qbk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index 4ae21f1..fa20d40 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -8,6 +8,7 @@ http://www.boost.org/LICENSE_1_0.txt ) ] + [id typeof] [last-revision $Date$] ] @@ -446,12 +447,12 @@ and template template parameters: * A type template parameter is described by the `(class)` or `(typename)` sequence element * A template parameter of a well-known integral type can be described by -simply supplying its type, like (`unsigned int`). +simply supplying its type, like `(unsigned int)`. The following well-known integral types are supported: - * [`signed`/`unsigned`] `char` - * [`unsigned`] `short` - * [`unsigned`] `int` - * [`unsigned`] `long` + * `[signed/unsigned] char` + * `[unsigned] short` + * `[unsigned] int` + * `[unsigned] long` * `unsigned` * `bool` * `size_t` From 7cbdf2406ae031f78c32584b7641ac0b9503d714 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Tue, 25 Apr 2006 00:57:46 +0000 Subject: [PATCH 05/35] Merged fix for VC PCH [SVN r33800] --- include/boost/typeof/encode_decode.hpp | 13 +- include/boost/typeof/encode_decode_params.hpp | 6 +- .../boost/typeof/integral_template_param.hpp | 4 +- include/boost/typeof/modifiers.hpp | 32 ++--- .../boost/typeof/pointers_data_members.hpp | 46 +++---- include/boost/typeof/register_functions.hpp | 2 +- .../typeof/register_functions_iterate.hpp | 119 +++++++++--------- .../boost/typeof/register_mem_functions.hpp | 2 +- include/boost/typeof/template_encoding.hpp | 6 +- .../boost/typeof/template_template_param.hpp | 28 ++--- include/boost/typeof/type_encoding.hpp | 8 +- include/boost/typeof/type_template_param.hpp | 4 +- 12 files changed, 132 insertions(+), 138 deletions(-) diff --git a/include/boost/typeof/encode_decode.hpp b/include/boost/typeof/encode_decode.hpp index 658fb77..03056be 100755 --- a/include/boost/typeof/encode_decode.hpp +++ b/include/boost/typeof/encode_decode.hpp @@ -8,7 +8,7 @@ #include #include -namespace boost { namespace type_of { namespace { + namespace { namespace boost_typeof { template struct encode_type_impl; @@ -18,17 +18,20 @@ namespace boost { namespace type_of { namespace { { typedef int type; // MSVC ETI workaround }; +}} - template - struct encode_type : encode_type_impl +namespace boost { namespace type_of { + + template + struct encode_type : boost_typeof::encode_type_impl {}; template - struct decode_type : decode_type_impl< + struct decode_type : boost_typeof::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 index 1b019f6..fd9e59b 100755 --- a/include/boost/typeof/encode_decode_params.hpp +++ b/include/boost/typeof/encode_decode_params.hpp @@ -11,7 +11,7 @@ // Assumes iter0 contains initial iterator #define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \ - typedef decode_type decode##n; \ + typedef boost::type_of::decode_type decode##n; \ typedef typename decode##n::type p##n; \ typedef typename decode##n::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); @@ -21,14 +21,14 @@ // The P0, P1, ... PN are encoded and added to V #define BOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\ - typename encode_type< + typename boost::type_of::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 \ + typename boost::type_of::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/integral_template_param.hpp b/include/boost/typeof/integral_template_param.hpp index 0a6e503..4e887df 100755 --- a/include/boost/typeof/integral_template_param.hpp +++ b/include/boost/typeof/integral_template_param.hpp @@ -55,14 +55,14 @@ // INTEGRAL_PARAM "virtual functions" implementation #define BOOST_TYPEOF_INTEGRAL_PARAM_ENCODE(This, n)\ - typedef typename encode_integral<\ + typedef typename boost::type_of::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);\ + typedef boost::type_of::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)); diff --git a/include/boost/typeof/modifiers.hpp b/include/boost/typeof/modifiers.hpp index 2da88e4..2d3f96f 100755 --- a/include/boost/typeof/modifiers.hpp +++ b/include/boost/typeof/modifiers.hpp @@ -16,16 +16,16 @@ template struct encode_type_impl\ {\ typedef\ - typename encode_type<\ - typename push_back<\ + typename boost::type_of::encode_type<\ + typename boost::type_of::push_back<\ V\ - , mpl::size_t >::type\ + , boost::mpl::size_t >::type\ , T>::type\ type;\ };\ - template struct decode_type_impl, Iter>\ + template struct decode_type_impl, Iter>\ {\ - typedef decode_type d1;\ + typedef boost::type_of::decode_type d1;\ typedef Fun(typename d1::type) type;\ typedef typename d1::iter iter;\ } @@ -36,7 +36,7 @@ #define BOOST_TYPEOF_pointer_fun(T) T* #define BOOST_TYPEOF_reference_fun(T) T& -namespace boost { namespace type_of { namespace { +namespace { namespace boost_typeof { BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_const_fun); BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_volatile_fun); @@ -44,7 +44,7 @@ namespace boost { namespace type_of { namespace { 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 @@ -60,32 +60,32 @@ namespace boost { namespace type_of { namespace { struct encode_type_impl\ {\ typedef\ - typename encode_type<\ - typename push_back<\ - typename push_back<\ + typename boost::type_of::encode_type<\ + typename boost::type_of::push_back<\ + typename boost::type_of::push_back<\ V\ - , mpl::size_t >::type\ - , mpl::size_t >::type\ + , boost::mpl::size_t >::type\ + , boost::mpl::size_t >::type\ , T>::type\ type;\ };\ template\ - struct decode_type_impl, Iter>\ + struct decode_type_impl, Iter>\ {\ enum{n = Iter::type::value};\ - typedef decode_type d;\ + typedef boost::type_of::decode_type d;\ typedef typename d::type Qualifier() type[n];\ typedef typename d::iter iter;\ } -namespace boost { namespace type_of { namespace { +namespace { namespace boost_typeof { BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_EMPTY); BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(const)); BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile)); BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile const)); -}}} +}} #undef BOOST_TYPEOF_array_support diff --git a/include/boost/typeof/pointers_data_members.hpp b/include/boost/typeof/pointers_data_members.hpp index ca6f349..a821425 100755 --- a/include/boost/typeof/pointers_data_members.hpp +++ b/include/boost/typeof/pointers_data_members.hpp @@ -10,35 +10,29 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -namespace boost -{ - namespace type_of +namespace { namespace boost_typeof { + + enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; + + template + struct encode_type_impl { - namespace - { - enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; + typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type; + }; - 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 decode_type_impl, Iter> - { - typedef Iter iter0; - BOOST_TYPEOF_DECODE_PARAMS(2) + template struct workaround{ + typedef p0 T::* type; + }; - template struct workaround{ - typedef p0 T::* type; - }; - - typedef typename workaround::type type; - typedef iter2 iter; - }; - } - } -} + 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 index fc53bfe..f7badb5 100755 --- a/include/boost/typeof/register_functions.hpp +++ b/include/boost/typeof/register_functions.hpp @@ -32,7 +32,7 @@ enum VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) }; -namespace boost { namespace type_of { +namespace { namespace boost_typeof { # define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) # define BOOST_PP_FILENAME_1 diff --git a/include/boost/typeof/register_functions_iterate.hpp b/include/boost/typeof/register_functions_iterate.hpp index 9aaea51..f381b5d 100755 --- a/include/boost/typeof/register_functions_iterate.hpp +++ b/include/boost/typeof/register_functions_iterate.hpp @@ -6,83 +6,80 @@ #define n BOOST_PP_ITERATION() -namespace +// function pointers + +template +struct encode_type_impl { - // function pointers + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type; +}; - 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; - }; +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; +}; #ifndef BOOST_TYPEOF_NO_FUNCTION_TYPES - // function references + // 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 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; - }; + 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 + // 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 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; - }; + 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; + }; #endif//BOOST_TYPEOF_NO_FUNCTION_TYPES - // member functions +// member functions - #define BOOST_TYPEOF_qualifier - #define BOOST_TYPEOF_id MEM_FUN_ID - #include +#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 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 +#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 -} +#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_mem_functions.hpp b/include/boost/typeof/register_mem_functions.hpp index 0959303..9cf9720 100755 --- a/include/boost/typeof/register_mem_functions.hpp +++ b/include/boost/typeof/register_mem_functions.hpp @@ -15,7 +15,7 @@ struct encode_type_impl -struct decode_type_impl, Iter> +struct decode_type_impl, Iter> { typedef Iter iter0; BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_ADD(n, 2)) diff --git a/include/boost/typeof/template_encoding.hpp b/include/boost/typeof/template_encoding.hpp index 00306ae..5de7732 100755 --- a/include/boost/typeof/template_encoding.hpp +++ b/include/boost/typeof/template_encoding.hpp @@ -128,14 +128,14 @@ BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params) #define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\ - namespace boost { namespace type_of { namespace {\ + namespace { namespace boost_typeof {\ BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\ template\ struct encode_type_impl >\ {\ - typedef typename push_back >::type V0;\ + typedef typename boost::type_of::push_back >::type V0;\ BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM, ~, Params)\ typedef BOOST_PP_CAT(V, Size) type;\ };\ @@ -147,6 +147,6 @@ 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 index 188414f..468d487 100755 --- a/include/boost/typeof/template_template_param.hpp +++ b/include/boost/typeof/template_template_param.hpp @@ -23,12 +23,12 @@ //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 boost::type_of::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)); @@ -51,22 +51,22 @@ //////////////////////////// // move to encode_decode? +namespace { namespace boost_typeof { + + template struct encode_template_impl; + template struct decode_template_impl; + +}} + 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 encode_template + : boost_typeof::encode_template_impl {}; template struct decode_template - : decode_template_impl + : boost_typeof::decode_template_impl {}; - }} //////////////////////////// @@ -81,10 +81,10 @@ namespace boost { namespace type_of { BOOST_PP_ENUM_PARAMS(\ BOOST_PP_SEQ_SIZE(Params),\ P)> >\ - : push_back >\ + : boost::type_of::push_back >\ {\ };\ - template struct decode_template_impl, Iter>\ + template struct decode_template_impl, Iter>\ {\ BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_TYPEDEF_INT_PN,_)\ typedef Name type;\ diff --git a/include/boost/typeof/type_encoding.hpp b/include/boost/typeof/type_encoding.hpp index 33195ce..281f529 100755 --- a/include/boost/typeof/type_encoding.hpp +++ b/include/boost/typeof/type_encoding.hpp @@ -8,18 +8,18 @@ #define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \ \ template struct encode_type_impl \ - : push_back > \ + : boost::type_of::push_back > \ {}; \ - template struct decode_type_impl, Iter> \ + template struct decode_type_impl, Iter> \ { \ typedef T type; \ typedef Iter iter; \ }; #define BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, Id) \ - namespace boost { namespace type_of { namespace { \ + namespace { namespace boost_typeof { \ BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, Id) \ - }}} + }} #define BOOST_TYPEOF_REGISTER_TYPE(Type) \ BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, BOOST_TYPEOF_UNIQUE_ID()) diff --git a/include/boost/typeof/type_template_param.hpp b/include/boost/typeof/type_template_param.hpp index 34e063c..d0bb77f 100755 --- a/include/boost/typeof/type_template_param.hpp +++ b/include/boost/typeof/type_template_param.hpp @@ -19,13 +19,13 @@ // TYPE_PARAM "virtual functions" implementation #define BOOST_TYPEOF_TYPE_PARAM_ENCODE(This, n)\ - typedef typename encode_type<\ + typedef typename boost::type_of::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 boost::type_of::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)); From 11b18afccee123061ef7f79350e85379941de205 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Mon, 5 Jun 2006 02:43:08 +0000 Subject: [PATCH 06/35] merged function binding [SVN r34176] --- test/function_ptr.cpp | 9 +++++++++ test/function_ref.cpp | 8 ++++++++ test/nested_typedef.cpp | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test/function_ptr.cpp b/test/function_ptr.cpp index 2e08a15..be08c11 100755 --- a/test/function_ptr.cpp +++ b/test/function_ptr.cpp @@ -4,3 +4,12 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); + +// check that const gets stripped from function pointer + +int foo(double); +typedef int(*PTR)(double); +typedef const PTR CPTR; +CPTR cptr = foo; + +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/function_ref.cpp b/test/function_ref.cpp index bc9f6ec..560ef53 100755 --- a/test/function_ref.cpp +++ b/test/function_ref.cpp @@ -2,3 +2,11 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); + +// check that function values/refs can be bound + +int foo(double); +typedef int(&FREF)(double); +FREF fref = *foo; + +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/nested_typedef.cpp b/test/nested_typedef.cpp index d1bb3e4..129307e 100644 --- a/test/nested_typedef.cpp +++ b/test/nested_typedef.cpp @@ -8,7 +8,7 @@ void do_int(int) {} struct { template - T operator[](const T&) {} + T operator[](const T& n) {return n;} } int_p; From 337fe1fdf610667c1250ab39745d8bf39a833e99 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Mon, 5 Jun 2006 02:50:05 +0000 Subject: [PATCH 07/35] merged function binding [SVN r34177] --- include/boost/typeof/msvc/typeof_impl.hpp | 24 +++++++++- include/boost/typeof/native.hpp | 57 +++++++++++++++++++++++ include/boost/typeof/typeof.hpp | 21 +-------- include/boost/typeof/typeof_impl.hpp | 20 ++++++-- 4 files changed, 98 insertions(+), 24 deletions(-) create mode 100755 include/boost/typeof/native.hpp diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp index c297e92..6b5a09b 100755 --- a/include/boost/typeof/msvc/typeof_impl.hpp +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -11,6 +11,8 @@ # include # include # include +# include +# include namespace boost { @@ -145,8 +147,28 @@ namespace boost BOOST_TYPEOF_NEXT_INDEX(next); }; + template + struct sizer + { + typedef char(*type)[encode_type::value]; + }; + +# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) + + template typename disable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T const&); + + template typename enable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T&); + +# else + template - char (*encode_start(T const&))[encode_type::value]; + typename sizer::type encode_start(T const&); + +# endif } } diff --git a/include/boost/typeof/native.hpp b/include/boost/typeof/native.hpp new file mode 100755 index 0000000..1c65a8c --- /dev/null +++ b/include/boost/typeof/native.hpp @@ -0,0 +1,57 @@ +// Copyright (C) 2006 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_NATIVE_HPP_INCLUDED +#define BOOST_TYPEOF_NATIVE_HPP_INCLUDED + +#ifndef MSVC_TYPEOF_HACK + +#ifdef BOOST_NO_SFINAE + +namespace boost { namespace type_of { + + template + T& ensure_obj(const T&); + +}} + +#else + +#include +#include + +namespace boost { namespace type_of { + + template + typename enable_if, T&>::type + ensure_obj(T&); + + template + typename disable_if, T&>::type + ensure_obj(const T&); + +}} + +#endif//BOOST_NO_SFINAE + +#define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr)) +#define BOOST_TYPEOF_TPL BOOST_TYPEOF + +#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ + struct name {\ + typedef BOOST_TYPEOF_TPL(expr) type;\ + }; + +#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ + struct name {\ + typedef BOOST_TYPEOF(expr) type;\ + }; + +#endif//MSVC_TYPEOF_HACK + +#define BOOST_TYPEOF_REGISTER_TYPE(x) +#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params) + +#endif//BOOST_TYPEOF_NATIVE_HPP_INCLUDED + diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp index 0a18158..7669cab 100755 --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -136,31 +136,12 @@ #elif defined(BOOST_TYPEOF_NATIVE) # define BOOST_TYPEOF_TEXT "using native typeof" -# ifndef MSVC_TYPEOF_HACK - - 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 -# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ - struct name {\ - typedef BOOST_TYPEOF_TPL(expr) type;\ - }; -# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ - struct name {\ - typedef BOOST_TYPEOF(expr) type;\ - }; -# endif -# define BOOST_TYPEOF_REGISTER_TYPE(x) -# define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params) +# include #else # error typeof configuration error #endif #include -#include // auto #define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index e3a36e0..1fd661a 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #define BOOST_TYPEOF_VECTOR(n) BOOST_PP_CAT(boost::type_of::vector, n) @@ -26,13 +28,25 @@ namespace boost { namespace type_of { BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_sizer_item, ~) }; - - template - sizer::type> encode(const T&); }} #undef BOOST_TYPEOF_sizer_item +// +namespace boost { namespace type_of { + + template + typename enable_if< + typename is_function::type, + sizer::type> >::type encode(T&); + + template + typename disable_if< + typename is_function::type, + sizer::type> >::type encode(const T&); + +}} +// namespace boost { namespace type_of { template From 47a4b2a2c1b2477f39fa1d2e744de94b99bd803a Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Wed, 7 Jun 2006 03:00:58 +0000 Subject: [PATCH 08/35] *** empty log message *** [SVN r34215] --- include/boost/typeof/msvc/typeof_impl.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp index 6b5a09b..3ce3544 100755 --- a/include/boost/typeof/msvc/typeof_impl.hpp +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -153,7 +153,12 @@ namespace boost typedef char(*type)[encode_type::value]; }; -# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) +# ifdef BOOST_NO_SFINAE + + template + typename sizer::type encode_start(T const&); + +# else template typename disable_if< typename is_function::type, @@ -163,11 +168,6 @@ namespace boost typename is_function::type, typename sizer::type>::type encode_start(T&); -# else - - template - typename sizer::type encode_start(T const&); - # endif } } From 9a14e20bc5eb04677d62537ca287a9136a77aa5f Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sun, 11 Jun 2006 12:05:52 +0000 Subject: [PATCH 09/35] *** empty log message *** [SVN r34270] --- include/boost/typeof/binding_workaround.hpp | 42 --------------------- test/Jamfile | 3 ++ test/function_binding.cpp | 10 +++++ test/function_ref.cpp | 8 ---- 4 files changed, 13 insertions(+), 50 deletions(-) delete mode 100755 include/boost/typeof/binding_workaround.hpp create mode 100755 test/function_binding.cpp diff --git a/include/boost/typeof/binding_workaround.hpp b/include/boost/typeof/binding_workaround.hpp deleted file mode 100755 index 1b5fc1d..0000000 --- a/include/boost/typeof/binding_workaround.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED -#define BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED - -// workarounds related to inability to bind to const T& - -/* -MSVC 7.1-, from inside a template, -can't bind a function pointer to const T& -*/ - -#include - -#if BOOST_WORKAROUND(BOOST_MSVC,==1310) && defined(BOOST_TYPEOF_EMULATION) - -#include -#include - -namespace boost { namespace type_of { - - template - sizer::type> encode(T*, - typename enable_if::type>::type* = 0); - -}} - -#elif BOOST_WORKAROUND(BOOST_MSVC,<=1310) && defined(BOOST_TYPEOF_NATIVE) - -#include -#include - -namespace boost { namespace type_of { - - template - char (*encode_start(T*))[encode_type::value]; - -}} - -#endif - -// - -#endif//BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED diff --git a/test/Jamfile b/test/Jamfile index f02d93c..8cac5c4 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -50,6 +50,9 @@ test-suite "typeof" [ compile function.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_native ] [ compile function.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_emulation ] + [ compile function_binding.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_binding_native ] + [ compile function_binding.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_binding_emulation ] + [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_native ] [ compile function_ptr.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_ptr_emulation ] diff --git a/test/function_binding.cpp b/test/function_binding.cpp new file mode 100755 index 0000000..4bee3a9 --- /dev/null +++ b/test/function_binding.cpp @@ -0,0 +1,10 @@ +#include +#include +#include +#include + +int foo(double); +typedef int(&FREF)(double); +FREF fref = *foo; + +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/function_ref.cpp b/test/function_ref.cpp index 560ef53..bc9f6ec 100755 --- a/test/function_ref.cpp +++ b/test/function_ref.cpp @@ -2,11 +2,3 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); - -// check that function values/refs can be bound - -int foo(double); -typedef int(&FREF)(double); -FREF fref = *foo; - -BOOST_STATIC_ASSERT((boost::is_same::value)); From db9203fb0e59136a6266bd8e27c6420f4a2af905 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sun, 18 Jun 2006 15:43:26 +0000 Subject: [PATCH 10/35] merged SUPPRESS_UNNAMED_NAMESPACE [SVN r34348] --- include/boost/typeof/encode_decode.hpp | 42 +++++++++++++------ include/boost/typeof/modifiers.hpp | 26 ++++++------ .../boost/typeof/pointers_data_members.hpp | 39 ++++++++--------- include/boost/typeof/register_functions.hpp | 11 ++--- include/boost/typeof/template_encoding.hpp | 4 +- .../boost/typeof/template_template_param.hpp | 12 +++--- include/boost/typeof/type_encoding.hpp | 6 +-- include/boost/typeof/typeof.hpp | 4 +- test/Jamfile | 41 +++++++++--------- test/odr_no_uns1.cpp | 15 +++++++ test/odr_no_uns1.hpp | 14 +++++++ test/odr_no_uns2.cpp | 10 +++++ test/odr_no_uns2.hpp | 14 +++++++ 13 files changed, 157 insertions(+), 81 deletions(-) create mode 100755 test/odr_no_uns1.cpp create mode 100755 test/odr_no_uns1.hpp create mode 100755 test/odr_no_uns2.cpp create mode 100755 test/odr_no_uns2.hpp diff --git a/include/boost/typeof/encode_decode.hpp b/include/boost/typeof/encode_decode.hpp index 03056be..8464fde 100755 --- a/include/boost/typeof/encode_decode.hpp +++ b/include/boost/typeof/encode_decode.hpp @@ -8,26 +8,44 @@ #include #include - namespace { namespace boost_typeof { +#ifndef BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE - template - struct encode_type_impl; - - template - struct decode_type_impl - { - typedef int type; // MSVC ETI workaround - }; -}} +# define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace { namespace boost_typeof { +# define BOOST_TYPEOF_END_ENCODE_NS }} +# define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost_typeof + +#else + +# define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace boost { namespace type_of { +# define BOOST_TYPEOF_END_ENCODE_NS }} +# define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost::type_of + +# define BOOST_TYPEOF_TEXT "unnamed namespace is off" +# include + +#endif + +BOOST_TYPEOF_BEGIN_ENCODE_NS + +template +struct encode_type_impl; + +template +struct decode_type_impl +{ + typedef int type; // MSVC ETI workaround +}; + +BOOST_TYPEOF_END_ENCODE_NS namespace boost { namespace type_of { template - struct encode_type : boost_typeof::encode_type_impl + struct encode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl {}; template - struct decode_type : boost_typeof::decode_type_impl< + struct decode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::decode_type_impl< typename Iter::type, typename Iter::next > diff --git a/include/boost/typeof/modifiers.hpp b/include/boost/typeof/modifiers.hpp index 2d3f96f..f1498aa 100755 --- a/include/boost/typeof/modifiers.hpp +++ b/include/boost/typeof/modifiers.hpp @@ -36,15 +36,15 @@ #define BOOST_TYPEOF_pointer_fun(T) T* #define BOOST_TYPEOF_reference_fun(T) T& -namespace { namespace boost_typeof { +BOOST_TYPEOF_BEGIN_ENCODE_NS - 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); +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); -}} +BOOST_TYPEOF_END_ENCODE_NS #undef BOOST_TYPEOF_modifier_support #undef BOOST_TYPEOF_const_fun @@ -78,14 +78,14 @@ namespace { namespace boost_typeof { typedef typename d::iter iter;\ } -namespace { namespace boost_typeof { +BOOST_TYPEOF_BEGIN_ENCODE_NS - BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_EMPTY); - BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(const)); - BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile)); - BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile const)); +BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_EMPTY); +BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(const)); +BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile)); +BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile const)); -}} +BOOST_TYPEOF_END_ENCODE_NS #undef BOOST_TYPEOF_array_support diff --git a/include/boost/typeof/pointers_data_members.hpp b/include/boost/typeof/pointers_data_members.hpp index a821425..69415b6 100755 --- a/include/boost/typeof/pointers_data_members.hpp +++ b/include/boost/typeof/pointers_data_members.hpp @@ -10,29 +10,30 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -namespace { namespace boost_typeof { +BOOST_TYPEOF_BEGIN_ENCODE_NS - enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; +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 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; }; - template - struct decode_type_impl, Iter> - { - typedef Iter iter0; - BOOST_TYPEOF_DECODE_PARAMS(2) + typedef typename workaround::type type; + typedef iter2 iter; +}; - template struct workaround{ - typedef p0 T::* type; - }; - - typedef typename workaround::type type; - typedef iter2 iter; - }; -}} +BOOST_TYPEOF_END_ENCODE_NS #endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED diff --git a/include/boost/typeof/register_functions.hpp b/include/boost/typeof/register_functions.hpp index f7badb5..2af7cec 100755 --- a/include/boost/typeof/register_functions.hpp +++ b/include/boost/typeof/register_functions.hpp @@ -32,11 +32,12 @@ enum VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) }; -namespace { namespace boost_typeof { +BOOST_TYPEOF_BEGIN_ENCODE_NS - # define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) - # define BOOST_PP_FILENAME_1 - # include BOOST_PP_ITERATE() -}} +# define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) +# define BOOST_PP_FILENAME_1 +# include BOOST_PP_ITERATE() + +BOOST_TYPEOF_END_ENCODE_NS #endif//BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED diff --git a/include/boost/typeof/template_encoding.hpp b/include/boost/typeof/template_encoding.hpp index 5de7732..322147f 100755 --- a/include/boost/typeof/template_encoding.hpp +++ b/include/boost/typeof/template_encoding.hpp @@ -128,7 +128,7 @@ BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params) #define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\ - namespace { namespace boost_typeof {\ + BOOST_TYPEOF_BEGIN_ENCODE_NS\ BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\ template struct encode_template_impl; - template struct decode_template_impl; +template struct encode_template_impl; +template struct decode_template_impl; -}} +BOOST_TYPEOF_END_ENCODE_NS namespace boost { namespace type_of { template struct encode_template - : boost_typeof::encode_template_impl + : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_template_impl {}; template struct decode_template - : boost_typeof::decode_template_impl + : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::decode_template_impl {}; }} diff --git a/include/boost/typeof/type_encoding.hpp b/include/boost/typeof/type_encoding.hpp index 281f529..130bd2a 100755 --- a/include/boost/typeof/type_encoding.hpp +++ b/include/boost/typeof/type_encoding.hpp @@ -17,9 +17,9 @@ }; #define BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, Id) \ - namespace { namespace boost_typeof { \ - BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, Id) \ - }} + BOOST_TYPEOF_BEGIN_ENCODE_NS \ + BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, Id) \ + BOOST_TYPEOF_END_ENCODE_NS #define BOOST_TYPEOF_REGISTER_TYPE(Type) \ BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, BOOST_TYPEOF_UNIQUE_ID()) diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp index 7669cab..c206354 100755 --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -126,6 +126,7 @@ #ifdef BOOST_TYPEOF_EMULATION # define BOOST_TYPEOF_TEXT "using typeof emulation" +# include # include # include # include @@ -136,13 +137,12 @@ #elif defined(BOOST_TYPEOF_NATIVE) # define BOOST_TYPEOF_TEXT "using native typeof" +# include # include #else # error typeof configuration error #endif -#include - // auto #define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr #define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr diff --git a/test/Jamfile b/test/Jamfile index 8cac5c4..1456ccc 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -24,59 +24,62 @@ local rule special-requirements ( toolset variant : properties * ) test-suite "typeof" : [ compile type.cpp : BOOST_TYPEOF_NATIVE special-requirements : type_native ] - [ compile type.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : type_emulation ] + [ compile type.cpp : BOOST_TYPEOF_EMULATION special-requirements : type_emulation ] [ compile template_type.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_type_native ] - [ compile template_type.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : template_type_emulation ] + [ compile template_type.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_type_emulation ] [ compile template_int.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_int_native ] - [ compile template_int.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : template_int_emulation ] + [ compile template_int.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_int_emulation ] [ compile template_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_tpl_native ] - [ compile template_tpl.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : template_tpl_emulation ] + [ compile template_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_tpl_emulation ] [ compile template_enum.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_enum_native ] - [ compile template_enum.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : template_enum_emulation ] + [ compile template_enum.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_enum_emulation ] [ compile template_dependent.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_dependent_native ] - [ compile template_dependent.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : template_dependent_emulation ] + [ compile template_dependent.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_dependent_emulation ] [ compile template_multiword.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_multiword_native ] - [ compile template_multiword.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : template_multiword_emulation ] + [ compile template_multiword.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_multiword_emulation ] [ compile modifiers.cpp : BOOST_TYPEOF_NATIVE special-requirements : modifiers_native ] - [ compile modifiers.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : modifiers_emulation ] + [ compile modifiers.cpp : BOOST_TYPEOF_EMULATION special-requirements : modifiers_emulation ] [ compile function.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_native ] - [ compile function.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_emulation ] + [ compile function.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_emulation ] [ compile function_binding.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_binding_native ] - [ compile function_binding.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_binding_emulation ] + [ compile function_binding.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_binding_emulation ] [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_native ] - [ compile function_ptr.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_ptr_emulation ] + [ compile function_ptr.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_emulation ] [ compile function_ref.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ref_native ] - [ compile function_ref.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_ref_emulation ] + [ compile function_ref.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ref_emulation ] [ compile member_function.cpp : BOOST_TYPEOF_NATIVE special-requirements : member_function_native ] - [ compile member_function.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : member_function_emulation ] + [ compile member_function.cpp : BOOST_TYPEOF_EMULATION special-requirements : member_function_emulation ] [ compile data_member.cpp : BOOST_TYPEOF_NATIVE special-requirements : data_member_native ] - [ compile data_member.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : data_member_emulation ] + [ compile data_member.cpp : BOOST_TYPEOF_EMULATION special-requirements : data_member_emulation ] [ compile noncopyable.cpp : BOOST_TYPEOF_NATIVE special-requirements : noncopyable_native ] - [ compile noncopyable.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : noncopyable_emulation ] + [ compile noncopyable.cpp : BOOST_TYPEOF_EMULATION special-requirements : noncopyable_emulation ] [ compile std.cpp : BOOST_TYPEOF_NATIVE special-requirements : std_native ] - [ compile std.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : std_emulation ] + [ compile std.cpp : BOOST_TYPEOF_EMULATION special-requirements : std_emulation ] [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_NATIVE special-requirements : odr_native ] - [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_COMPLIANT special-requirements : odr_emulation ] + [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_emulation ] [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_from_tpl_native ] - [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : function_ptr_from_tpl_emulation ] + [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_from_tpl_emulation ] [ compile nested_typedef.cpp : BOOST_TYPEOF_NATIVE special-requirements : nested_typedef_native ] - [ compile nested_typedef.cpp : BOOST_TYPEOF_COMPLIANT special-requirements : nested_typedef_emulation ] + [ compile nested_typedef.cpp : BOOST_TYPEOF_EMULATION special-requirements : nested_typedef_emulation ] + + [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_no_uns ] + ; diff --git a/test/odr_no_uns1.cpp b/test/odr_no_uns1.cpp new file mode 100755 index 0000000..bbf8540 --- /dev/null +++ b/test/odr_no_uns1.cpp @@ -0,0 +1,15 @@ +#include "odr_no_uns1.hpp" +#include "odr_no_uns2.hpp" + +void odr_no_uns1() +{ + odr_test_1 t1; + odr_test_2 t2; + BOOST_AUTO(v1, t1); + BOOST_AUTO(v2, t2); +} + +int main() +{ + return 0; +} diff --git a/test/odr_no_uns1.hpp b/test/odr_no_uns1.hpp new file mode 100755 index 0000000..fb65470 --- /dev/null +++ b/test/odr_no_uns1.hpp @@ -0,0 +1,14 @@ +#ifndef BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED +#define BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED + +#define BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct odr_test_1 +{}; + +BOOST_TYPEOF_REGISTER_TYPE(odr_test_1) + +#endif//BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED diff --git a/test/odr_no_uns2.cpp b/test/odr_no_uns2.cpp new file mode 100755 index 0000000..8386771 --- /dev/null +++ b/test/odr_no_uns2.cpp @@ -0,0 +1,10 @@ +#include "odr_no_uns2.hpp" +#include "odr_no_uns1.hpp" + +void odr_no_uns2() +{ + odr_test_1 t1; + odr_test_2 t2; + BOOST_AUTO(v1, t1); + BOOST_AUTO(v2, t2); +} diff --git a/test/odr_no_uns2.hpp b/test/odr_no_uns2.hpp new file mode 100755 index 0000000..5c41c94 --- /dev/null +++ b/test/odr_no_uns2.hpp @@ -0,0 +1,14 @@ +#ifndef BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED +#define BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED + +#define BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE +#include + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +struct odr_test_2 +{}; + +BOOST_TYPEOF_REGISTER_TYPE(odr_test_2) + +#endif//BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED From a460694e5da29e6167f1eb8c3049c11e324eb5c1 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sun, 25 Jun 2006 23:59:21 +0000 Subject: [PATCH 11/35] *** empty log message *** [SVN r34402] --- test/Jamfile.v2 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4f180b2..4cf201d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -24,7 +24,7 @@ rule typeof-test ( source ) { return [ compile $(source) : BOOST_TYPEOF_NATIVE : $(source:B)_native ] - [ compile $(source) : BOOST_TYPEOF_COMPLIANT : + [ compile $(source) : BOOST_TYPEOF_EMULATION : $(source:B)_emulation ] ; } @@ -32,14 +32,17 @@ rule typeof-test ( source ) rule all-tests ( ) { local all ; - for local t in [ set.difference [ glob *.cpp ] : odr1.cpp odr2.cpp ] +# for local t in [ set.difference [ glob *.cpp ] : odr1.cpp odr2.cpp ] + for local t in [ set.difference [ glob *.cpp ] : [ glob odr*.cpp ] ] { all += [ typeof-test $(t) ] ; } all += [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_NATIVE : odr_native ] ; - all += [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_COMPLIANT : + all += [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_EMULATION : odr_emulation ] ; + all += [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : BOOST_TYPEOF_EMULATION : + odr_no_uns ] ; return $(all) ; } From dff8a5c505e56ca636aabed196dc3bbd49427ea4 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Thu, 27 Jul 2006 11:48:49 +0000 Subject: [PATCH 12/35] boost guidelines (mainly from inspect tool: tabs, license reference text, etc.); more to do... [SVN r34753] --- include/boost/typeof/encode_decode.hpp | 22 +++---- include/boost/typeof/encode_decode_params.hpp | 10 +-- .../boost/typeof/integral_template_param.hpp | 8 +-- include/boost/typeof/modifiers.hpp | 16 ++--- .../typeof/register_functions_iterate.hpp | 64 +++++++++---------- include/boost/typeof/template_encoding.hpp | 10 +-- .../boost/typeof/template_template_param.hpp | 12 ++-- include/boost/typeof/type_encoding.hpp | 14 ++-- include/boost/typeof/type_template_param.hpp | 8 +-- include/boost/typeof/typeof.hpp | 8 +-- include/boost/typeof/typeof_impl.hpp | 20 +++--- 11 files changed, 96 insertions(+), 96 deletions(-) diff --git a/include/boost/typeof/encode_decode.hpp b/include/boost/typeof/encode_decode.hpp index 8464fde..2612f78 100755 --- a/include/boost/typeof/encode_decode.hpp +++ b/include/boost/typeof/encode_decode.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED #define BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED @@ -10,18 +10,18 @@ #ifndef BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE -# define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace { namespace boost_typeof { -# define BOOST_TYPEOF_END_ENCODE_NS }} -# define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost_typeof +# define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace { namespace boost_typeof { +# define BOOST_TYPEOF_END_ENCODE_NS }} +# define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost_typeof #else -# define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace boost { namespace type_of { -# define BOOST_TYPEOF_END_ENCODE_NS }} -# define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost::type_of +# define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace boost { namespace type_of { +# define BOOST_TYPEOF_END_ENCODE_NS }} +# define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost::type_of # define BOOST_TYPEOF_TEXT "unnamed namespace is off" -# include +# include #endif @@ -40,8 +40,8 @@ BOOST_TYPEOF_END_ENCODE_NS namespace boost { namespace type_of { - template - struct encode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl + template + struct encode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl {}; template diff --git a/include/boost/typeof/encode_decode_params.hpp b/include/boost/typeof/encode_decode_params.hpp index fd9e59b..640bfdc 100755 --- a/include/boost/typeof/encode_decode_params.hpp +++ b/include/boost/typeof/encode_decode_params.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED #define BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED @@ -11,7 +11,7 @@ // Assumes iter0 contains initial iterator #define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \ - typedef boost::type_of::decode_type decode##n; \ + typedef boost::type_of::decode_type decode##n; \ typedef typename decode##n::type p##n; \ typedef typename decode##n::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); @@ -21,14 +21,14 @@ // The P0, P1, ... PN are encoded and added to V #define BOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\ - typename boost::type_of::encode_type< + typename boost::type_of::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 boost::type_of::push_back >::type \ + typename boost::type_of::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/integral_template_param.hpp b/include/boost/typeof/integral_template_param.hpp index 4e887df..8543be7 100755 --- a/include/boost/typeof/integral_template_param.hpp +++ b/include/boost/typeof/integral_template_param.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED #define BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED @@ -55,14 +55,14 @@ // INTEGRAL_PARAM "virtual functions" implementation #define BOOST_TYPEOF_INTEGRAL_PARAM_ENCODE(This, n)\ - typedef typename boost::type_of::encode_integral<\ + typedef typename boost::type_of::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 boost::type_of::decode_integral BOOST_PP_CAT(d, n);\ + typedef boost::type_of::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)); diff --git a/include/boost/typeof/modifiers.hpp b/include/boost/typeof/modifiers.hpp index f1498aa..cfb276b 100755 --- a/include/boost/typeof/modifiers.hpp +++ b/include/boost/typeof/modifiers.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED #define BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED @@ -16,14 +16,14 @@ template struct encode_type_impl\ {\ typedef\ - typename boost::type_of::encode_type<\ + typename boost::type_of::encode_type<\ typename boost::type_of::push_back<\ V\ - , boost::mpl::size_t >::type\ + , boost::mpl::size_t >::type\ , T>::type\ type;\ };\ - template struct decode_type_impl, Iter>\ + template struct decode_type_impl, Iter>\ {\ typedef boost::type_of::decode_type d1;\ typedef Fun(typename d1::type) type;\ @@ -64,13 +64,13 @@ BOOST_TYPEOF_END_ENCODE_NS typename boost::type_of::push_back<\ typename boost::type_of::push_back<\ V\ - , boost::mpl::size_t >::type\ - , boost::mpl::size_t >::type\ + , boost::mpl::size_t >::type\ + , boost::mpl::size_t >::type\ , T>::type\ type;\ };\ template\ - struct decode_type_impl, Iter>\ + struct decode_type_impl, Iter>\ {\ enum{n = Iter::type::value};\ typedef boost::type_of::decode_type d;\ diff --git a/include/boost/typeof/register_functions_iterate.hpp b/include/boost/typeof/register_functions_iterate.hpp index f381b5d..643dc98 100755 --- a/include/boost/typeof/register_functions_iterate.hpp +++ b/include/boost/typeof/register_functions_iterate.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include @@ -26,41 +26,41 @@ struct decode_type_impl, Iter> #ifndef BOOST_TYPEOF_NO_FUNCTION_TYPES - // function references + // 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 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; - }; + 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 + // 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 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; - }; + 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; + }; #endif//BOOST_TYPEOF_NO_FUNCTION_TYPES diff --git a/include/boost/typeof/template_encoding.hpp b/include/boost/typeof/template_encoding.hpp index 322147f..1a638ed 100755 --- a/include/boost/typeof/template_encoding.hpp +++ b/include/boost/typeof/template_encoding.hpp @@ -1,7 +1,7 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED #define BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED @@ -128,14 +128,14 @@ BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params) #define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\ - BOOST_TYPEOF_BEGIN_ENCODE_NS\ + BOOST_TYPEOF_BEGIN_ENCODE_NS\ BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\ template\ struct encode_type_impl >\ {\ - typedef typename boost::type_of::push_back >::type V0;\ + typedef typename boost::type_of::push_back >::type V0;\ BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM, ~, Params)\ typedef BOOST_PP_CAT(V, Size) type;\ };\ @@ -147,6 +147,6 @@ BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name, Params)\ typedef BOOST_PP_CAT(iter, Size) iter;\ };\ - BOOST_TYPEOF_END_ENCODE_NS + BOOST_TYPEOF_END_ENCODE_NS #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 index f88365d..3a26639 100755 --- a/include/boost/typeof/template_template_param.hpp +++ b/include/boost/typeof/template_template_param.hpp @@ -1,7 +1,7 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED #define BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED @@ -60,8 +60,8 @@ BOOST_TYPEOF_END_ENCODE_NS namespace boost { namespace type_of { - template struct encode_template - : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_template_impl + template struct encode_template + : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_template_impl {}; template struct decode_template @@ -81,10 +81,10 @@ namespace boost { namespace type_of { BOOST_PP_ENUM_PARAMS(\ BOOST_PP_SEQ_SIZE(Params),\ P)> >\ - : boost::type_of::push_back >\ + : boost::type_of::push_back >\ {\ };\ - template struct decode_template_impl, Iter>\ + template struct decode_template_impl, Iter>\ {\ BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_TYPEDEF_INT_PN,_)\ typedef Name type;\ diff --git a/include/boost/typeof/type_encoding.hpp b/include/boost/typeof/type_encoding.hpp index 130bd2a..f8c74ed 100755 --- a/include/boost/typeof/type_encoding.hpp +++ b/include/boost/typeof/type_encoding.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED #define BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED @@ -8,18 +8,18 @@ #define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \ \ template struct encode_type_impl \ - : boost::type_of::push_back > \ + : boost::type_of::push_back > \ {}; \ - template struct decode_type_impl, Iter> \ + template struct decode_type_impl, Iter> \ { \ typedef T type; \ typedef Iter iter; \ }; #define BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, Id) \ - BOOST_TYPEOF_BEGIN_ENCODE_NS \ - BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, Id) \ - BOOST_TYPEOF_END_ENCODE_NS + BOOST_TYPEOF_BEGIN_ENCODE_NS \ + BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, Id) \ + BOOST_TYPEOF_END_ENCODE_NS #define BOOST_TYPEOF_REGISTER_TYPE(Type) \ BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, BOOST_TYPEOF_UNIQUE_ID()) diff --git a/include/boost/typeof/type_template_param.hpp b/include/boost/typeof/type_template_param.hpp index d0bb77f..28a860c 100755 --- a/include/boost/typeof/type_template_param.hpp +++ b/include/boost/typeof/type_template_param.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED #define BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED @@ -19,13 +19,13 @@ // TYPE_PARAM "virtual functions" implementation #define BOOST_TYPEOF_TYPE_PARAM_ENCODE(This, n)\ - typedef typename boost::type_of::encode_type<\ + typedef typename boost::type_of::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 boost::type_of::decode_type< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ + typedef boost::type_of::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)); diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp index c206354..10d8a0a 100755 --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -1,6 +1,6 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED #define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED @@ -126,7 +126,7 @@ #ifdef BOOST_TYPEOF_EMULATION # define BOOST_TYPEOF_TEXT "using typeof emulation" -# include +# include # include # include # include @@ -137,7 +137,7 @@ #elif defined(BOOST_TYPEOF_NATIVE) # define BOOST_TYPEOF_TEXT "using native typeof" -# include +# include # include #else # error typeof configuration error diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index 1fd661a..aa62cf6 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -1,7 +1,7 @@ // 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) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED #define BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED @@ -35,15 +35,15 @@ namespace boost { namespace type_of { // namespace boost { namespace type_of { - template - typename enable_if< - typename is_function::type, - sizer::type> >::type encode(T&); + template + typename enable_if< + typename is_function::type, + sizer::type> >::type encode(T&); - template - typename disable_if< - typename is_function::type, - sizer::type> >::type encode(const T&); + template + typename disable_if< + typename is_function::type, + sizer::type> >::type encode(const T&); }} // From 2b92bbcb21b16f41006f40ab10651f0266cca4a1 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Mon, 28 Aug 2006 16:57:08 +0000 Subject: [PATCH 13/35] Merged from HEAD, Fixed issue with BOOST_TYPEOF_NESTED_TYPEDEF for CW in emulation mode [SVN r34983] --- include/boost/typeof/typeof_impl.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index aa62cf6..9c23de6 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -107,6 +107,19 @@ namespace boost { namespace type_of { typedef _typeof_fraction_iter next;\ }; +#ifdef __MWERKS__ + +# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ +template\ +struct BOOST_PP_CAT(_typeof_template_,name) {\ + BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ + typedef typename boost::type_of::decode_type<_typeof_fraction_iter > >::type type;\ +};\ +typedef BOOST_PP_CAT(_typeof_template_,name) name; + +# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) BOOST_TYPEOF_NESTED_TYPEDEF(name,expr); + +#else # define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ struct name {\ BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ @@ -118,5 +131,6 @@ namespace boost { namespace type_of { BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ typedef boost::type_of::decode_type<_typeof_fraction_iter > >::type type;\ }; +#endif #endif//BOOST_TYPEOF_COMPLIANT_TYPEOF_IMPL_HPP_INCLUDED From aede9c2866aec137588b6e4d3297d07e61017756 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 29 Aug 2006 21:14:51 +0000 Subject: [PATCH 14/35] Remove tabs [SVN r34996] --- include/boost/typeof/typeof_impl.hpp | 4 +- test/Jamfile | 82 ++++++++++++++-------------- test/odr_no_uns1.cpp | 10 ++-- test/odr_no_uns2.cpp | 8 +-- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index 9c23de6..8bfe65c 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -112,8 +112,8 @@ namespace boost { namespace type_of { # define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ template\ struct BOOST_PP_CAT(_typeof_template_,name) {\ - BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ - typedef typename boost::type_of::decode_type<_typeof_fraction_iter > >::type type;\ + BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ + typedef typename boost::type_of::decode_type<_typeof_fraction_iter > >::type type;\ };\ typedef BOOST_PP_CAT(_typeof_template_,name) name; diff --git a/test/Jamfile b/test/Jamfile index 1456ccc..2ed41c2 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -22,64 +22,64 @@ local rule special-requirements ( toolset variant : properties * ) } test-suite "typeof" - : - [ compile type.cpp : BOOST_TYPEOF_NATIVE special-requirements : type_native ] - [ compile type.cpp : BOOST_TYPEOF_EMULATION special-requirements : type_emulation ] + : + [ compile type.cpp : BOOST_TYPEOF_NATIVE special-requirements : type_native ] + [ compile type.cpp : BOOST_TYPEOF_EMULATION special-requirements : type_emulation ] - [ compile template_type.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_type_native ] - [ compile template_type.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_type_emulation ] + [ compile template_type.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_type_native ] + [ compile template_type.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_type_emulation ] - [ compile template_int.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_int_native ] - [ compile template_int.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_int_emulation ] + [ compile template_int.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_int_native ] + [ compile template_int.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_int_emulation ] - [ compile template_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_tpl_native ] - [ compile template_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_tpl_emulation ] + [ compile template_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_tpl_native ] + [ compile template_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_tpl_emulation ] - [ compile template_enum.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_enum_native ] - [ compile template_enum.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_enum_emulation ] + [ compile template_enum.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_enum_native ] + [ compile template_enum.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_enum_emulation ] - [ compile template_dependent.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_dependent_native ] - [ compile template_dependent.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_dependent_emulation ] + [ compile template_dependent.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_dependent_native ] + [ compile template_dependent.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_dependent_emulation ] - [ compile template_multiword.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_multiword_native ] - [ compile template_multiword.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_multiword_emulation ] + [ compile template_multiword.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_multiword_native ] + [ compile template_multiword.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_multiword_emulation ] - [ compile modifiers.cpp : BOOST_TYPEOF_NATIVE special-requirements : modifiers_native ] - [ compile modifiers.cpp : BOOST_TYPEOF_EMULATION special-requirements : modifiers_emulation ] + [ compile modifiers.cpp : BOOST_TYPEOF_NATIVE special-requirements : modifiers_native ] + [ compile modifiers.cpp : BOOST_TYPEOF_EMULATION special-requirements : modifiers_emulation ] - [ compile function.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_native ] - [ compile function.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_emulation ] + [ compile function.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_native ] + [ compile function.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_emulation ] - [ compile function_binding.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_binding_native ] - [ compile function_binding.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_binding_emulation ] + [ compile function_binding.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_binding_native ] + [ compile function_binding.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_binding_emulation ] - [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_native ] - [ compile function_ptr.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_emulation ] + [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_native ] + [ compile function_ptr.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_emulation ] - [ compile function_ref.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ref_native ] - [ compile function_ref.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ref_emulation ] + [ compile function_ref.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ref_native ] + [ compile function_ref.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ref_emulation ] - [ compile member_function.cpp : BOOST_TYPEOF_NATIVE special-requirements : member_function_native ] - [ compile member_function.cpp : BOOST_TYPEOF_EMULATION special-requirements : member_function_emulation ] + [ compile member_function.cpp : BOOST_TYPEOF_NATIVE special-requirements : member_function_native ] + [ compile member_function.cpp : BOOST_TYPEOF_EMULATION special-requirements : member_function_emulation ] - [ compile data_member.cpp : BOOST_TYPEOF_NATIVE special-requirements : data_member_native ] - [ compile data_member.cpp : BOOST_TYPEOF_EMULATION special-requirements : data_member_emulation ] + [ compile data_member.cpp : BOOST_TYPEOF_NATIVE special-requirements : data_member_native ] + [ compile data_member.cpp : BOOST_TYPEOF_EMULATION special-requirements : data_member_emulation ] - [ compile noncopyable.cpp : BOOST_TYPEOF_NATIVE special-requirements : noncopyable_native ] - [ compile noncopyable.cpp : BOOST_TYPEOF_EMULATION special-requirements : noncopyable_emulation ] + [ compile noncopyable.cpp : BOOST_TYPEOF_NATIVE special-requirements : noncopyable_native ] + [ compile noncopyable.cpp : BOOST_TYPEOF_EMULATION special-requirements : noncopyable_emulation ] - [ compile std.cpp : BOOST_TYPEOF_NATIVE special-requirements : std_native ] - [ compile std.cpp : BOOST_TYPEOF_EMULATION special-requirements : std_emulation ] + [ compile std.cpp : BOOST_TYPEOF_NATIVE special-requirements : std_native ] + [ compile std.cpp : BOOST_TYPEOF_EMULATION special-requirements : std_emulation ] - [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_NATIVE special-requirements : odr_native ] - [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_emulation ] + [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_NATIVE special-requirements : odr_native ] + [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_emulation ] - [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_from_tpl_native ] - [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_from_tpl_emulation ] + [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_from_tpl_native ] + [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_from_tpl_emulation ] - [ compile nested_typedef.cpp : BOOST_TYPEOF_NATIVE special-requirements : nested_typedef_native ] - [ compile nested_typedef.cpp : BOOST_TYPEOF_EMULATION special-requirements : nested_typedef_emulation ] + [ compile nested_typedef.cpp : BOOST_TYPEOF_NATIVE special-requirements : nested_typedef_native ] + [ compile nested_typedef.cpp : BOOST_TYPEOF_EMULATION special-requirements : nested_typedef_emulation ] - [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_no_uns ] + [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_no_uns ] - ; + ; diff --git a/test/odr_no_uns1.cpp b/test/odr_no_uns1.cpp index bbf8540..3baf343 100755 --- a/test/odr_no_uns1.cpp +++ b/test/odr_no_uns1.cpp @@ -3,13 +3,13 @@ void odr_no_uns1() { - odr_test_1 t1; - odr_test_2 t2; - BOOST_AUTO(v1, t1); - BOOST_AUTO(v2, t2); + odr_test_1 t1; + odr_test_2 t2; + BOOST_AUTO(v1, t1); + BOOST_AUTO(v2, t2); } int main() { - return 0; + return 0; } diff --git a/test/odr_no_uns2.cpp b/test/odr_no_uns2.cpp index 8386771..e664787 100755 --- a/test/odr_no_uns2.cpp +++ b/test/odr_no_uns2.cpp @@ -3,8 +3,8 @@ void odr_no_uns2() { - odr_test_1 t1; - odr_test_2 t2; - BOOST_AUTO(v1, t1); - BOOST_AUTO(v2, t2); + odr_test_1 t1; + odr_test_2 t2; + BOOST_AUTO(v1, t1); + BOOST_AUTO(v2, t2); } From 366ab1b621673244c553f5738bb52e0c846093ba Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Wed, 30 Aug 2006 17:18:13 +0000 Subject: [PATCH 15/35] Merged from HEAD: Disable enable_if for compiler that does not support it. [SVN r35000] --- include/boost/typeof/native.hpp | 7 +++++-- include/boost/typeof/typeof_impl.hpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/boost/typeof/native.hpp b/include/boost/typeof/native.hpp index 1c65a8c..4861782 100755 --- a/include/boost/typeof/native.hpp +++ b/include/boost/typeof/native.hpp @@ -22,7 +22,10 @@ namespace boost { namespace type_of { #include namespace boost { namespace type_of { - +# ifdef BOOST_NO_SFINAE + template + sizer::type> encode(const T&); +# else template typename enable_if, T&>::type ensure_obj(T&); @@ -30,7 +33,7 @@ namespace boost { namespace type_of { template typename disable_if, T&>::type ensure_obj(const T&); - +# endif }} #endif//BOOST_NO_SFINAE diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index 8bfe65c..7426905 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -34,7 +34,10 @@ namespace boost { namespace type_of { // namespace boost { namespace type_of { - +# ifdef BOOST_NO_SFINAE + template + sizer::type> encode(const T&); +# else template typename enable_if< typename is_function::type, @@ -44,7 +47,7 @@ namespace boost { namespace type_of { typename disable_if< typename is_function::type, sizer::type> >::type encode(const T&); - +# endif }} // namespace boost { namespace type_of { From 55ac93f94796e6bfbf867f9f5e4f43d229295a93 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Thu, 31 Aug 2006 11:00:14 +0000 Subject: [PATCH 16/35] Merged from HEAD Fixed error in code for supporting compilers without SFINAE. [SVN r35012] --- include/boost/typeof/native.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/typeof/native.hpp b/include/boost/typeof/native.hpp index 4861782..e52d1d4 100755 --- a/include/boost/typeof/native.hpp +++ b/include/boost/typeof/native.hpp @@ -23,8 +23,8 @@ namespace boost { namespace type_of { namespace boost { namespace type_of { # ifdef BOOST_NO_SFINAE - template - sizer::type> encode(const T&); + template + T& encode(const T&); # else template typename enable_if, T&>::type From 5bd010787a3773272f8278b96ef7aeb8ec148b2b Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Fri, 1 Sep 2006 19:25:45 +0000 Subject: [PATCH 17/35] Fixed issues with support for compilers without SFINAE [SVN r35017] --- include/boost/typeof/native.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/typeof/native.hpp b/include/boost/typeof/native.hpp index e52d1d4..f4a70c8 100755 --- a/include/boost/typeof/native.hpp +++ b/include/boost/typeof/native.hpp @@ -24,7 +24,7 @@ namespace boost { namespace type_of { namespace boost { namespace type_of { # ifdef BOOST_NO_SFINAE template - T& encode(const T&); + T& ensure_obj(const T&); # else template typename enable_if, T&>::type From 935b36d8f5347a58620a369af97a7707b61bc446 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Wed, 6 Sep 2006 17:12:45 +0000 Subject: [PATCH 18/35] Merged from HEAD: Support typeof emulation for DMC: Integral argument support. [SVN r35024] --- include/boost/typeof/int_encoding.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/typeof/int_encoding.hpp b/include/boost/typeof/int_encoding.hpp index 3078b69..dea1bbd 100755 --- a/include/boost/typeof/int_encoding.hpp +++ b/include/boost/typeof/int_encoding.hpp @@ -68,9 +68,8 @@ namespace boost { namespace type_of { {}; template - struct encode_integral : encode_size_t< V, (typename get_unsigned::type)n > + struct encode_integral : encode_size_t< V, (typename get_unsigned::type)n,(((typename get_unsigned::type)n)>=0x3fffffff) > {}; - /////////////////////////// template From dddbb00da467f10cb2fa01957aa33f7d2cc8b9db Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Fri, 8 Sep 2006 16:21:49 +0000 Subject: [PATCH 19/35] Merged from HEAD: DMC support for BOOST_TYPEOF_NESTED_TYPEDEF [SVN r35049] --- include/boost/typeof/typeof_impl.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index 7426905..0802199 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -94,6 +94,18 @@ namespace boost { namespace type_of { BOOST_STATIC_CONSTANT(int,BOOST_PP_CAT(value,n) = sizeof(boost::type_of::encode<_typeof_start_vector>(expr).item ## n));\ typedef boost::mpl::size_t BOOST_PP_CAT(item,n); +#ifdef __DMC__ +#define BOOST_TYPEOF_NESTED_TYPEITEM_2(z,n,expr)\ + typedef typename _typeof_encode_fraction::BOOST_PP_CAT(item,n) BOOST_PP_CAT(item,n); + +#define BOOST_TYPEOF_FRACTIONTYPE()\ + BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM_2,_)\ + typedef _typeof_fraction_iter fraction_type; +#else +#define BOOST_TYPEOF_FRACTIONTYPE()\ + typedef _typeof_encode_fraction fraction_type; +#endif + #define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \ template\ struct _typeof_encode_fraction {\ @@ -106,7 +118,8 @@ namespace boost { namespace type_of { BOOST_STATIC_CONSTANT(int,pos=(Pos::value));\ BOOST_STATIC_CONSTANT(int,iteration=(pos/BOOST_TYPEOF_LIMIT_SIZE));\ BOOST_STATIC_CONSTANT(int,where=pos%BOOST_TYPEOF_LIMIT_SIZE);\ - typedef typename boost::type_of::v_iter<_typeof_encode_fraction,boost::mpl::int_ >::type type;\ + BOOST_TYPEOF_FRACTIONTYPE();\ + typedef typename boost::type_of::v_iter >::type type;\ typedef _typeof_fraction_iter next;\ }; From d337b0837a995dfc805d4497fd63f33960857ac7 Mon Sep 17 00:00:00 2001 From: nobody Date: Sat, 9 Sep 2006 17:25:10 +0000 Subject: [PATCH 20/35] This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'. [SVN r35052] --- include/boost/typeof/incr_registration_group.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 include/boost/typeof/incr_registration_group.hpp diff --git a/include/boost/typeof/incr_registration_group.hpp b/include/boost/typeof/incr_registration_group.hpp new file mode 100755 index 0000000..6f4803a --- /dev/null +++ b/include/boost/typeof/incr_registration_group.hpp @@ -0,0 +1,14 @@ +// Copyright (C) 2004, 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) + +// Inclusion of this file increments BOOST_TYPEOF_REGISTRATION_GROUP +// This method was suggested by Paul Mensonides + +#ifdef BOOST_TYPEOF_EMULATION +# undef BOOST_TYPEOF_REGISTRATION_GROUP + +# include +# include BOOST_PP_UPDATE_COUNTER() +# define BOOST_TYPEOF_REGISTRATION_GROUP BOOST_PP_COUNTER +#endif From 64ba3be86f5f12d5212034ea97a70233ccc2aa4b Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sat, 9 Sep 2006 17:43:02 +0000 Subject: [PATCH 21/35] merged inspection report fixes [SVN r35053] --- .../boost/typeof/increment_registration_group.hpp | 14 -------------- include/boost/typeof/type_encoding.hpp | 2 +- include/boost/typeof/typeof.hpp | 2 +- index.html | 6 ++++++ test/Jamfile | 4 ++++ test/Jamfile.v2 | 5 +++++ test/data_member.cpp | 4 ++++ test/function.cpp | 4 ++++ test/function_binding.cpp | 4 ++++ test/function_ptr.cpp | 4 ++++ test/function_ptr_from_tpl.cpp | 4 ++++ test/function_ref.cpp | 4 ++++ test/member_function.cpp | 4 ++++ test/modifiers.cpp | 4 ++++ test/nested_typedef.cpp | 4 ++++ test/noncopyable.cpp | 4 ++++ test/odr.hpp | 4 ++++ test/odr1.cpp | 4 ++++ test/odr2.cpp | 4 ++++ test/odr_no_uns1.cpp | 4 ++++ test/odr_no_uns1.hpp | 4 ++++ test/odr_no_uns2.cpp | 4 ++++ test/odr_no_uns2.hpp | 4 ++++ test/std.cpp | 4 ++++ test/template_dependent.cpp | 4 ++++ test/template_enum.cpp | 4 ++++ test/template_int.cpp | 4 ++++ test/template_multiword.cpp | 4 ++++ test/template_tpl.cpp | 4 ++++ test/template_type.cpp | 4 ++++ test/type.cpp | 4 ++++ 31 files changed, 117 insertions(+), 16 deletions(-) delete mode 100755 include/boost/typeof/increment_registration_group.hpp diff --git a/include/boost/typeof/increment_registration_group.hpp b/include/boost/typeof/increment_registration_group.hpp deleted file mode 100755 index 6f4803a..0000000 --- a/include/boost/typeof/increment_registration_group.hpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2004, 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) - -// Inclusion of this file increments BOOST_TYPEOF_REGISTRATION_GROUP -// This method was suggested by Paul Mensonides - -#ifdef BOOST_TYPEOF_EMULATION -# undef BOOST_TYPEOF_REGISTRATION_GROUP - -# include -# include BOOST_PP_UPDATE_COUNTER() -# define BOOST_TYPEOF_REGISTRATION_GROUP BOOST_PP_COUNTER -#endif diff --git a/include/boost/typeof/type_encoding.hpp b/include/boost/typeof/type_encoding.hpp index f8c74ed..e0378c2 100755 --- a/include/boost/typeof/type_encoding.hpp +++ b/include/boost/typeof/type_encoding.hpp @@ -8,7 +8,7 @@ #define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \ \ template struct encode_type_impl \ - : boost::type_of::push_back > \ + : boost::type_of::push_back > \ {}; \ template struct decode_type_impl, Iter> \ { \ diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp index 10d8a0a..7228b5c 100755 --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -122,7 +122,7 @@ BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__ #define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\ - + #ifdef BOOST_TYPEOF_EMULATION # define BOOST_TYPEOF_TEXT "using typeof emulation" diff --git a/index.html b/index.html index c215f0c..0ba1c8c 100755 --- a/index.html +++ b/index.html @@ -1,3 +1,9 @@ + + diff --git a/test/Jamfile b/test/Jamfile index 2ed41c2..6777ae0 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -1,3 +1,7 @@ +# Copyright (C) 2006 Arkadiy Vertleyb +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + # Boost Typeof Library test Jamfile subproject libs/typeof/test ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4cf201d..28d7beb 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,3 +1,8 @@ +# Copyright (C) 2006 Vladimir Prus +# Copyright (C) 2006 Arkadiy Vertleyb +# Use, modification and distribution is subject to the Boost Software +# License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + # Boost Typeof Library test Jamfile import set ; diff --git a/test/data_member.cpp b/test/data_member.cpp index 4fd7ab4..b8fdc3a 100755 --- a/test/data_member.cpp +++ b/test/data_member.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/function.cpp b/test/function.cpp index 7ccda62..86a4df2 100755 --- a/test/function.cpp +++ b/test/function.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/function_binding.cpp b/test/function_binding.cpp index 4bee3a9..8ad1cf2 100755 --- a/test/function_binding.cpp +++ b/test/function_binding.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 #include #include diff --git a/test/function_ptr.cpp b/test/function_ptr.cpp index be08c11..c6babfb 100755 --- a/test/function_ptr.cpp +++ b/test/function_ptr.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/function_ptr_from_tpl.cpp b/test/function_ptr_from_tpl.cpp index 28986d1..7b880a2 100755 --- a/test/function_ptr_from_tpl.cpp +++ b/test/function_ptr_from_tpl.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 #include #include diff --git a/test/function_ref.cpp b/test/function_ref.cpp index bc9f6ec..b524e2a 100755 --- a/test/function_ref.cpp +++ b/test/function_ref.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/member_function.cpp b/test/member_function.cpp index 2e08a15..a7fbd9f 100755 --- a/test/member_function.cpp +++ b/test/member_function.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" BOOST_STATIC_ASSERT(boost::type_of::test::value); diff --git a/test/modifiers.cpp b/test/modifiers.cpp index f67d5c9..8c44233 100755 --- a/test/modifiers.cpp +++ b/test/modifiers.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/nested_typedef.cpp b/test/nested_typedef.cpp index 129307e..7eee2eb 100644 --- a/test/nested_typedef.cpp +++ b/test/nested_typedef.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 Peder Holt +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + #include #include #include diff --git a/test/noncopyable.cpp b/test/noncopyable.cpp index 687c782..833fbf0 100755 --- a/test/noncopyable.cpp +++ b/test/noncopyable.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/odr.hpp b/test/odr.hpp index 0f0f315..3eccc35 100755 --- a/test/odr.hpp +++ b/test/odr.hpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 struct foo diff --git a/test/odr1.cpp b/test/odr1.cpp index a11657c..5d36d6d 100755 --- a/test/odr1.cpp +++ b/test/odr1.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "odr.hpp" #include diff --git a/test/odr2.cpp b/test/odr2.cpp index aebd7c3..abfc291 100755 --- a/test/odr2.cpp +++ b/test/odr2.cpp @@ -1 +1,5 @@ +// Copyright (C) 2006 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 "odr.hpp" diff --git a/test/odr_no_uns1.cpp b/test/odr_no_uns1.cpp index 3baf343..55ea970 100755 --- a/test/odr_no_uns1.cpp +++ b/test/odr_no_uns1.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "odr_no_uns1.hpp" #include "odr_no_uns2.hpp" diff --git a/test/odr_no_uns1.hpp b/test/odr_no_uns1.hpp index fb65470..9c02490 100755 --- a/test/odr_no_uns1.hpp +++ b/test/odr_no_uns1.hpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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_ODR_NO_UNS1_HPP_INCLUDED #define BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED diff --git a/test/odr_no_uns2.cpp b/test/odr_no_uns2.cpp index e664787..9d35aef 100755 --- a/test/odr_no_uns2.cpp +++ b/test/odr_no_uns2.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "odr_no_uns2.hpp" #include "odr_no_uns1.hpp" diff --git a/test/odr_no_uns2.hpp b/test/odr_no_uns2.hpp index 5c41c94..2dad7d5 100755 --- a/test/odr_no_uns2.hpp +++ b/test/odr_no_uns2.hpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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_ODR_NO_UNS2_HPP_INCLUDED #define BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED diff --git a/test/std.cpp b/test/std.cpp index 1cce1d2..e6bfdaf 100755 --- a/test/std.cpp +++ b/test/std.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include diff --git a/test/template_dependent.cpp b/test/template_dependent.cpp index 462a1ee..da5a045 100755 --- a/test/template_dependent.cpp +++ b/test/template_dependent.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/template_enum.cpp b/test/template_enum.cpp index db72917..0e72a98 100755 --- a/test/template_enum.cpp +++ b/test/template_enum.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/template_int.cpp b/test/template_int.cpp index 9ed0919..92ee3e9 100755 --- a/test/template_int.cpp +++ b/test/template_int.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include diff --git a/test/template_multiword.cpp b/test/template_multiword.cpp index d4e9e0b..65ea15c 100755 --- a/test/template_multiword.cpp +++ b/test/template_multiword.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/template_tpl.cpp b/test/template_tpl.cpp index 84227cb..40d85fc 100755 --- a/test/template_tpl.cpp +++ b/test/template_tpl.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/template_type.cpp b/test/template_type.cpp index f7d0e96..e4ece64 100755 --- a/test/template_type.cpp +++ b/test/template_type.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() diff --git a/test/type.cpp b/test/type.cpp index 50fcdb2..5d372b8 100755 --- a/test/type.cpp +++ b/test/type.cpp @@ -1,3 +1,7 @@ +// Copyright (C) 2006 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 "test.hpp" #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() From 340148f738b241a98d9da0aaa65c578de75abd17 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Sun, 10 Sep 2006 16:55:21 +0000 Subject: [PATCH 22/35] merged removed tab [SVN r35057] --- include/boost/typeof/native.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/typeof/native.hpp b/include/boost/typeof/native.hpp index f4a70c8..8197e28 100755 --- a/include/boost/typeof/native.hpp +++ b/include/boost/typeof/native.hpp @@ -25,7 +25,7 @@ namespace boost { namespace type_of { # ifdef BOOST_NO_SFINAE template T& ensure_obj(const T&); -# else +# else template typename enable_if, T&>::type ensure_obj(T&); From eda5c4afbaa34a47d5978d99b9c60e19ed1c6610 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Sun, 10 Sep 2006 17:43:17 +0000 Subject: [PATCH 23/35] Merged from HEAD: Added name to copyright. [SVN r35060] --- test/odr_no_uns1.cpp | 1 + test/odr_no_uns1.hpp | 1 + test/odr_no_uns2.cpp | 1 + test/odr_no_uns2.hpp | 1 + 4 files changed, 4 insertions(+) diff --git a/test/odr_no_uns1.cpp b/test/odr_no_uns1.cpp index 55ea970..8bf5a99 100755 --- a/test/odr_no_uns1.cpp +++ b/test/odr_no_uns1.cpp @@ -1,4 +1,5 @@ // Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) diff --git a/test/odr_no_uns1.hpp b/test/odr_no_uns1.hpp index 9c02490..ef1e34d 100755 --- a/test/odr_no_uns1.hpp +++ b/test/odr_no_uns1.hpp @@ -1,4 +1,5 @@ // Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) diff --git a/test/odr_no_uns2.cpp b/test/odr_no_uns2.cpp index 9d35aef..649d581 100755 --- a/test/odr_no_uns2.cpp +++ b/test/odr_no_uns2.cpp @@ -1,4 +1,5 @@ // Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) diff --git a/test/odr_no_uns2.hpp b/test/odr_no_uns2.hpp index 2dad7d5..a384ccf 100755 --- a/test/odr_no_uns2.hpp +++ b/test/odr_no_uns2.hpp @@ -1,4 +1,5 @@ // Copyright (C) 2006 Arkadiy Vertleyb +// Copyright (C) 2006 Peder Holt // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) From 1b65bfc95d618de4fb78418dd501b3347a65322d Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Thu, 14 Sep 2006 17:39:57 +0000 Subject: [PATCH 24/35] Merged from HEAD: Fixed warnings on VC7.1 on integral encoding of bool [SVN r35110] --- include/boost/typeof/int_encoding.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/typeof/int_encoding.hpp b/include/boost/typeof/int_encoding.hpp index dea1bbd..5b2bec4 100755 --- a/include/boost/typeof/int_encoding.hpp +++ b/include/boost/typeof/int_encoding.hpp @@ -70,6 +70,14 @@ namespace boost { namespace type_of { template struct encode_integral : encode_size_t< V, (typename get_unsigned::type)n,(((typename get_unsigned::type)n)>=0x3fffffff) > {}; + + template + struct encode_integral : encode_size_t< V, 1,false> + {}; + + template + struct encode_integral : encode_size_t< V, 0,false> + {}; /////////////////////////// template From eeff4e592cd2728a15fc47a298dbb6ce5caca639 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Fri, 15 Sep 2006 02:11:47 +0000 Subject: [PATCH 25/35] Merged supress inspection unnamed namespace [SVN r35118] --- test/odr.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/odr.hpp b/test/odr.hpp index 3eccc35..9368e4c 100755 --- a/test/odr.hpp +++ b/test/odr.hpp @@ -2,6 +2,8 @@ // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) +// boostinspect:nounnamed + #include struct foo From 452b493b7ad511a2df4e41be1a631b1382629615 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Fri, 15 Sep 2006 02:19:55 +0000 Subject: [PATCH 26/35] merged suppress inspection complain about unnamed ns [SVN r35119] --- include/boost/typeof/encode_decode.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/typeof/encode_decode.hpp b/include/boost/typeof/encode_decode.hpp index 2612f78..e5d1be9 100755 --- a/include/boost/typeof/encode_decode.hpp +++ b/include/boost/typeof/encode_decode.hpp @@ -2,6 +2,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// boostinspect:nounnamed + #ifndef BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED #define BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED From 8868adc8911e4225e033d403794cff865fca6af9 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Sat, 16 Sep 2006 17:36:03 +0000 Subject: [PATCH 27/35] Merged from HEAD: Changed specialization of encode_integral for bool to work around issues with the sun compiler [SVN r35135] --- include/boost/typeof/int_encoding.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/boost/typeof/int_encoding.hpp b/include/boost/typeof/int_encoding.hpp index 5b2bec4..552c250 100755 --- a/include/boost/typeof/int_encoding.hpp +++ b/include/boost/typeof/int_encoding.hpp @@ -71,12 +71,8 @@ namespace boost { namespace type_of { struct encode_integral : encode_size_t< V, (typename get_unsigned::type)n,(((typename get_unsigned::type)n)>=0x3fffffff) > {}; - template - struct encode_integral : encode_size_t< V, 1,false> - {}; - - template - struct encode_integral : encode_size_t< V, 0,false> + template + struct encode_integral : encode_size_t< V, b?1:0, false> {}; /////////////////////////// From 43b4d4522c47b9559e56b3729035c5553695545f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 6 Nov 2006 17:10:46 +0000 Subject: [PATCH 28/35] Remove obsolete Boost.Build v1 files. [SVN r35880] --- test/Jamfile | 89 ---------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100755 test/Jamfile diff --git a/test/Jamfile b/test/Jamfile deleted file mode 100755 index 6777ae0..0000000 --- a/test/Jamfile +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (C) 2006 Arkadiy Vertleyb -# Use, modification and distribution is subject to the Boost Software -# License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) - -# Boost Typeof Library test Jamfile - -subproject libs/typeof/test ; - -# bring in rules for testing -import testing ; - -local rule special-requirements ( toolset variant : properties * ) -{ - # Tru64/CXX6.5 hangs on most tests, so just turn it off completely. - - if $(UNIX) && $(OS) = OSF - { - switch $(toolset) - { - case tru64cxx65* : properties = - [ replace-properties $(properties) : no ] ; - } - } - - return $(properties) ; -} - -test-suite "typeof" - : - [ compile type.cpp : BOOST_TYPEOF_NATIVE special-requirements : type_native ] - [ compile type.cpp : BOOST_TYPEOF_EMULATION special-requirements : type_emulation ] - - [ compile template_type.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_type_native ] - [ compile template_type.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_type_emulation ] - - [ compile template_int.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_int_native ] - [ compile template_int.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_int_emulation ] - - [ compile template_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_tpl_native ] - [ compile template_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_tpl_emulation ] - - [ compile template_enum.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_enum_native ] - [ compile template_enum.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_enum_emulation ] - - [ compile template_dependent.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_dependent_native ] - [ compile template_dependent.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_dependent_emulation ] - - [ compile template_multiword.cpp : BOOST_TYPEOF_NATIVE special-requirements : template_multiword_native ] - [ compile template_multiword.cpp : BOOST_TYPEOF_EMULATION special-requirements : template_multiword_emulation ] - - [ compile modifiers.cpp : BOOST_TYPEOF_NATIVE special-requirements : modifiers_native ] - [ compile modifiers.cpp : BOOST_TYPEOF_EMULATION special-requirements : modifiers_emulation ] - - [ compile function.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_native ] - [ compile function.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_emulation ] - - [ compile function_binding.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_binding_native ] - [ compile function_binding.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_binding_emulation ] - - [ compile function_ptr.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_native ] - [ compile function_ptr.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_emulation ] - - [ compile function_ref.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ref_native ] - [ compile function_ref.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ref_emulation ] - - [ compile member_function.cpp : BOOST_TYPEOF_NATIVE special-requirements : member_function_native ] - [ compile member_function.cpp : BOOST_TYPEOF_EMULATION special-requirements : member_function_emulation ] - - [ compile data_member.cpp : BOOST_TYPEOF_NATIVE special-requirements : data_member_native ] - [ compile data_member.cpp : BOOST_TYPEOF_EMULATION special-requirements : data_member_emulation ] - - [ compile noncopyable.cpp : BOOST_TYPEOF_NATIVE special-requirements : noncopyable_native ] - [ compile noncopyable.cpp : BOOST_TYPEOF_EMULATION special-requirements : noncopyable_emulation ] - - [ compile std.cpp : BOOST_TYPEOF_NATIVE special-requirements : std_native ] - [ compile std.cpp : BOOST_TYPEOF_EMULATION special-requirements : std_emulation ] - - [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_NATIVE special-requirements : odr_native ] - [ run odr1.cpp odr2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_emulation ] - - [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_NATIVE special-requirements : function_ptr_from_tpl_native ] - [ compile function_ptr_from_tpl.cpp : BOOST_TYPEOF_EMULATION special-requirements : function_ptr_from_tpl_emulation ] - - [ compile nested_typedef.cpp : BOOST_TYPEOF_NATIVE special-requirements : nested_typedef_native ] - [ compile nested_typedef.cpp : BOOST_TYPEOF_EMULATION special-requirements : nested_typedef_emulation ] - - [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : BOOST_TYPEOF_EMULATION special-requirements : odr_no_uns ] - - ; From c66289f7ac0fcd5c3342e49fd3a81bd3b5d76a08 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Sun, 4 Feb 2007 09:29:20 +0000 Subject: [PATCH 29/35] From HEAD: Added documentation: BOOST_TYPEOF_NESTED_TYPEDEF can not be used at function/block scope [SVN r36886] --- doc/typeof.qbk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index fa20d40..70c6b2e 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -586,6 +586,8 @@ larger expressions. If you want to use `typeof_nested_typedef` in a template-context, use `BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr)`, which takes care of `typename` inside the `typeof` expression. +'typeof_nested_typedef' can not be used at function/block scope. + [h4 Sample Code] template From ed21868c25f8b2a7b160338c6a649743fb5a1bea Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Tue, 6 Feb 2007 01:50:40 +0000 Subject: [PATCH 30/35] tutorial text fix [SVN r36898] --- doc/typeof.qbk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index 70c6b2e..786d877 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -101,6 +101,10 @@ and becomes widely available. [section:tuto Tutorial] +To start using typeof include the typeof header: + + #include + To deduce the type of an expression at compile time use the `BOOST_TYPEOF` macro: From f7df17a93a37f66c83c24c1a4f13cf92f9089423 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Wed, 2 May 2007 20:03:05 +0000 Subject: [PATCH 31/35] Merged doc fix [SVN r37564] --- doc/typeof.qbk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index 786d877..548c505 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -80,8 +80,8 @@ she would have to specify something like this: Not exactly elegant. To solve this problem (as well as some other problems), the C++ standard committee is considering a few additions to the standard language, such as `typeof/decltype` and `auto` (see -[@http://www.osl.iu.edu/~jajarvi/publications/papers/decltype_n1478.pdf -http://www.osl.iu.edu/~jajarvi/publications/papers/decltype_n1478.pdf]). +[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf +http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf]). The `typeof` operator (or `decltype`, which is a slightly different flavor of `typeof`) allows one to determine the type of an expression at compile time. Using `typeof`, @@ -844,7 +844,7 @@ as nested classes. Instead, instantiations can be registered: [endsect] -[section:ackn Acknoledgements] +[section:ackn Acknowledgements] The idea of representing a type as multiple compile-time integers, and passing these integers across function boundaries using sizeof(), From 84ec781ea1fd939d90d642e6b0d34717c3baad5d Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 24 Jul 2007 19:28:14 +0000 Subject: [PATCH 32/35] This commit was manufactured by cvs2svn to create tag 'Version_1_34_1'. [SVN r38286] From 8d8d35c1ae55e98e7f90955c5850fac1919ef8a4 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 5 Oct 2007 14:25:06 +0000 Subject: [PATCH 33/35] Starting point for releases [SVN r39706] From 3ecb3bf10253f70c168c4056bb81658d39124ba0 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:38:02 +0000 Subject: [PATCH 34/35] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41370] --- doc/typeof.qbk | 10 ++++++---- test/modifiers.cpp | 3 +++ test/test.hpp | 13 +++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/doc/typeof.qbk b/doc/typeof.qbk index 548c505..31be5e7 100644 --- a/doc/typeof.qbk +++ b/doc/typeof.qbk @@ -644,12 +644,14 @@ that allows a nested class of base to be defined in a class derived from base: //Use the base class to access the type. typedef typeof_access::id2type::type type; -This method has also been adapted to VC7.0, where the nested class +Peder Holt adapted this method to VC7.0, where the nested class is a template class that is specialized in the derived class. -The loopholes have been fixed in VC8.0 though, so on this compiler -this method doesn't work. + +In VC8.0, it seemed that all the bug-featire had been fixed, but +Steven Watanabe managed to implement a more rigorous version of the VC7.0 fix that +enables 'typeof' to be supported 'natively' here as well. -For this and many other compilers neither native `typeof` support +For many other compilers neither native `typeof` support nor the trick described above is an option. For such compilers the emulation method is the only way of implementing `typeof`. diff --git a/test/modifiers.cpp b/test/modifiers.cpp index 8c44233..41a9da9 100755 --- a/test/modifiers.cpp +++ b/test/modifiers.cpp @@ -14,3 +14,6 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); +BOOST_STATIC_ASSERT(boost::type_of::test::value); + diff --git a/test/test.hpp b/test/test.hpp index f0cb166..cd694c0 100755 --- a/test/test.hpp +++ b/test/test.hpp @@ -8,23 +8,24 @@ #include #include #include +#include namespace boost { namespace type_of { - template + template struct test_wrapper{}; - template + template T test_make(T*); - template + template struct test { - enum {value = boost::is_same< + BOOST_STATIC_CONSTANT(std::size_t,value = (boost::is_same< BOOST_TYPEOF_TPL(test_make((test_wrapper*)0)), test_wrapper - >::value - }; + >::value) + ); }; }} From cde21a588d6d8bf357f8e9f59fd98c16fcb3f122 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Thu, 20 Dec 2007 12:04:40 +0000 Subject: [PATCH 35/35] Merged from trunk: for visual studio 8 and visual studio 9, reverted to using sizeof in 'native' typeof operator as the use of typeid caused compilation error in visual studio source code analysis. [SVN r42200] --- include/boost/typeof/msvc/typeof_impl.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp index 1a7c980..2f58c18 100755 --- a/include/boost/typeof/msvc/typeof_impl.hpp +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -153,7 +153,7 @@ namespace boost }; }; # endif -# if BOOST_WORKAROUND(BOOST_MSVC,>=1310) +# if BOOST_WORKAROUND(BOOST_MSVC,==1310) template struct msvc_typeid_wrapper { typedef typename msvc_extract_type::id2type id2type; @@ -184,6 +184,7 @@ namespace boost template msvc_register_type typeof_register_type(const T&); + # define BOOST_TYPEOF(expr) \ boost::type_of::msvc_typeid_wrapper::type @@ -239,10 +240,18 @@ struct name {\ { typedef char(*type)[encode_type::value]; }; +# if BOOST_WORKAROUND(BOOST_MSVC,>=1310) + template typename disable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T const&); + template typename enable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T&); +# else template typename sizer::type encode_start(T const&); - +# endif template msvc_register_type typeof_register_type(const T&,Organizer* =0);