mirror of
https://github.com/boostorg/typeof.git
synced 2025-07-30 12:57:29 +02:00
Fixed problem with extra typename in BOOST_LVALUE_TYPEOF in native MSVC mode.
[SVN r2614]
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
|
||||
# define BOOST_TYPEOF_TPL BOOST_TYPEOF
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// auto
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user