diff --git a/include/boost/typeof/binding_workaround.hpp b/include/boost/typeof/binding_workaround.hpp new file mode 100755 index 0000000..1b5fc1d --- /dev/null +++ b/include/boost/typeof/binding_workaround.hpp @@ -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 + +#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/include/boost/typeof/increment_registration_group.hpp b/include/boost/typeof/increment_registration_group.hpp new file mode 100755 index 0000000..6f4803a --- /dev/null +++ b/include/boost/typeof/increment_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 diff --git a/include/boost/typeof/int_encoding.hpp b/include/boost/typeof/int_encoding.hpp index 552c250..5b2bec4 100755 --- a/include/boost/typeof/int_encoding.hpp +++ b/include/boost/typeof/int_encoding.hpp @@ -71,8 +71,12 @@ 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, b?1:0, false> + template + struct encode_integral : encode_size_t< V, 1,false> + {}; + + template + struct encode_integral : encode_size_t< V, 0,false> {}; /////////////////////////// diff --git a/include/boost/typeof/msvc/typeof_impl.hpp b/include/boost/typeof/msvc/typeof_impl.hpp index c29b388..3ce3544 100755 --- a/include/boost/typeof/msvc/typeof_impl.hpp +++ b/include/boost/typeof/msvc/typeof_impl.hpp @@ -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 - struct msvc_extract_type; - - template - struct msvc_extract_type { - template - struct id2type_impl; - - typedef id2type_impl id2type; - }; - - template - struct msvc_extract_type : msvc_extract_type - { - template<> - struct id2type_impl //VC8.0 specific bugfeature - { - typedef T type; - }; - template - struct id2type_impl; - - typedef id2type_impl id2type; - }; - - template - struct msvc_register_type : msvc_extract_type - { - }; # else template struct msvc_extract_type diff --git a/include/boost/typeof/typeof.hpp b/include/boost/typeof/typeof.hpp index a124e4c..7228b5c 100755 --- a/include/boost/typeof/typeof.hpp +++ b/include/boost/typeof/typeof.hpp @@ -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 # 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