forked from boostorg/typeof
This commit was manufactured by cvs2svn to create tag
'merged_to_RC_1_34_0'. [SVN r37938]
This commit is contained in:
42
include/boost/typeof/binding_workaround.hpp
Executable file
42
include/boost/typeof/binding_workaround.hpp
Executable file
@@ -0,0 +1,42 @@
|
||||
#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 <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,==1310) && defined(BOOST_TYPEOF_EMULATION)
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
|
||||
namespace boost { namespace type_of {
|
||||
|
||||
template<class V,class T>
|
||||
sizer<typename encode_type<V, T*>::type> encode(T*,
|
||||
typename enable_if<typename is_function<T>::type>::type* = 0);
|
||||
|
||||
}}
|
||||
|
||||
#elif BOOST_WORKAROUND(BOOST_MSVC,<=1310) && defined(BOOST_TYPEOF_NATIVE)
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
|
||||
namespace boost { namespace type_of {
|
||||
|
||||
template<typename T>
|
||||
char (*encode_start(T*))[encode_type<T*>::value];
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
#endif//BOOST_TYPEOF_BINDING_WORKAROUND_HPP_INCLUDED
|
14
include/boost/typeof/increment_registration_group.hpp
Executable file
14
include/boost/typeof/increment_registration_group.hpp
Executable file
@@ -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 <boost/preprocessor/slot/counter.hpp>
|
||||
# include BOOST_PP_UPDATE_COUNTER()
|
||||
# define BOOST_TYPEOF_REGISTRATION_GROUP BOOST_PP_COUNTER
|
||||
#endif
|
@@ -71,8 +71,12 @@ namespace boost { namespace type_of {
|
||||
struct encode_integral : encode_size_t< V, (typename get_unsigned<T>::type)n,(((typename get_unsigned<T>::type)n)>=0x3fffffff) >
|
||||
{};
|
||||
|
||||
template<class V, bool b>
|
||||
struct encode_integral<V, bool, b> : encode_size_t< V, b?1:0, false>
|
||||
template<class V>
|
||||
struct encode_integral<V,bool,true> : encode_size_t< V, 1,false>
|
||||
{};
|
||||
|
||||
template<class V>
|
||||
struct encode_integral<V,bool,false> : encode_size_t< V, 0,false>
|
||||
{};
|
||||
///////////////////////////
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
|
||||
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com (VC 6.5,VC 7.1 + counter code)
|
||||
// Copyright (C) 2005 Peder Holt (VC 7.0 + framework)
|
||||
// Copyright (C) 2006 Steven Watanabe (VC 8.0)
|
||||
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com
|
||||
// Copyright (C) 2005 Peder Holt
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -100,38 +99,6 @@ namespace boost
|
||||
typedef T type;
|
||||
};
|
||||
};
|
||||
#elif BOOST_WORKAROUND(BOOST_MSVC,==1400)
|
||||
struct msvc_extract_type_default_param {};
|
||||
|
||||
template<typename ID, typename T = msvc_extract_type_default_param>
|
||||
struct msvc_extract_type;
|
||||
|
||||
template<typename ID>
|
||||
struct msvc_extract_type<ID, msvc_extract_type_default_param> {
|
||||
template<bool>
|
||||
struct id2type_impl;
|
||||
|
||||
typedef id2type_impl<true> id2type;
|
||||
};
|
||||
|
||||
template<typename ID, typename T>
|
||||
struct msvc_extract_type : msvc_extract_type<ID,msvc_extract_type_default_param>
|
||||
{
|
||||
template<>
|
||||
struct id2type_impl<true> //VC8.0 specific bugfeature
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
template<bool>
|
||||
struct id2type_impl;
|
||||
|
||||
typedef id2type_impl<true> id2type;
|
||||
};
|
||||
|
||||
template<typename T, typename ID>
|
||||
struct msvc_register_type : msvc_extract_type<ID, T>
|
||||
{
|
||||
};
|
||||
# else
|
||||
template<typename ID>
|
||||
struct msvc_extract_type
|
||||
|
@@ -87,7 +87,7 @@
|
||||
# else
|
||||
# error typeof emulation is not supported
|
||||
# endif
|
||||
# elif (_MSC_VER >= 1310) // 7.1, 8.0
|
||||
# elif (_MSC_VER == 1310) // 7.1
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
@@ -95,14 +95,14 @@
|
||||
# include <boost/typeof/msvc/typeof_impl.hpp>
|
||||
# define MSVC_TYPEOF_HACK
|
||||
# endif
|
||||
/*# else // 8.0
|
||||
# else // 8.0
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# error native typeof is not supported
|
||||
# endif*/
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#else //unknown compiler
|
||||
|
Reference in New Issue
Block a user