Fixed problem with extra typename in BOOST_LVALUE_TYPEOF in native MSVC mode.

[SVN r2614]
This commit is contained in:
Peder Holt
2005-06-08 06:09:09 +00:00
parent cdc03862c9
commit bc7af3a7e7
4 changed files with 20 additions and 16 deletions

View File

@ -7,6 +7,7 @@
#define BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED
#include <boost/type_traits/is_const.hpp>
#include <boost/typeof/typeof.hpp>
namespace boost
{
@ -76,17 +77,7 @@ namespace boost
// Since this is always a type,
// just add "typename" when using in templates
#ifndef BOOST_TYPEOF_COMPLIANT
#define BOOST_LVALUE_TYPEOF(expr) \
boost::type_of::decorate_type< \
BOOST_TYPEOF(expr), \
sizeof(*boost::type_of::classify_expression(expr)) \
>::type
#else //BOOST_TYPEOF_COMPLIANT
#include <boost/typeof/typeof_impl.hpp>
#if defined BOOST_TYPEOF_COMPLIANT || (defined(BOOST_TYPEOF_NATIVE) && defined(BOOST_MSVC))
namespace boost { namespace type_of {
@ -94,7 +85,7 @@ namespace boost { namespace type_of {
struct decorate_decode_begin
{
typedef typename decorate_type<
typename decode_begin<V>::type,
typename V::type,
n
>::type type;
};
@ -102,10 +93,18 @@ namespace boost { namespace type_of {
#define BOOST_LVALUE_TYPEOF(expr) \
boost::type_of::decorate_decode_begin< \
BOOST_TYPEOF_ENCODED_VECTOR(expr), \
BOOST_TYPEOF_NO_TYPE(expr), \
sizeof(*boost::type_of::classify_expression(expr)) \
>::type
#endif
#else //BOOST_TYPEOF_NATIVE
#define BOOST_LVALUE_TYPEOF(expr) \
boost::type_of::decorate_type< \
BOOST_TYPEOF(expr), \
sizeof(*boost::type_of::classify_expression(expr)) \
>::type
#endif//BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED

View File

@ -148,8 +148,11 @@ namespace boost
}
}
# define BOOST_TYPEOF_NO_TYPE(expr) \
boost::type_of::msvc_typeid_wrapper<sizeof(*boost::type_of::encode_start(expr))>
# define BOOST_TYPEOF(expr) \
boost::type_of::msvc_typeid_wrapper<sizeof(*boost::type_of::encode_start(expr))>::type
BOOST_TYPEOF_NO_TYPE(expr)::type
# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr)

View File

@ -47,6 +47,7 @@
# define BOOST_TYPEOF_TPL BOOST_TYPEOF
#endif
// auto

View File

@ -51,8 +51,9 @@ namespace boost { namespace type_of {
BOOST_PP_ENUM(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_TYPEITEM, Expr) \
>
#define BOOST_TYPEOF(Expr)\
boost::type_of::decode_begin<BOOST_TYPEOF_ENCODED_VECTOR(Expr) >::type
#define BOOST_TYPEOF_NO_TYPE(Expr)\
boost::type_of::decode_begin<BOOST_TYPEOF_ENCODED_VECTOR(Expr) >
#define BOOST_TYPEOF(Expr) BOOST_TYPEOF_NO_TYPE(Expr)::type
#define BOOST_TYPEOF_TPL typename BOOST_TYPEOF