Compare commits

..

11 Commits

Author SHA1 Message Date
Jonathan Turkanis aaa46861c6 Branch for Iostreams development
[SVN r42144]
2007-12-18 20:08:11 +00:00
Peder Holt 6926249653 Revert to old sizeof based solution for retrieving the type from a typeof hack. This is in order to overcome problems with the code analysis module introduced in Visual Studio 2005.
[SVN r41383]
2007-11-25 21:16:46 +00:00
Peder Holt 9aa58de5e2 #1425 Support for Visual Studio 2008
[SVN r41027]
2007-11-12 11:10:20 +00:00
Peder Holt 6c09ce7883 Fixed duplicate definition of boost::type_of::push_back when BOOST_TYPEOF_LIMIT_SIZE>50 and not a multiple of 50. (From Dave Jenkins)
[SVN r40540]
2007-10-29 08:05:17 +00:00
Peder Holt b06d94eb91 Deleted regression tests.
[SVN r40435]
2007-10-24 20:30:31 +00:00
Peder Holt 7a574a6169 [typeof] testing for typeof hacks on all compilers
[SVN r39796]
2007-10-08 17:46:23 +00:00
Peder Holt 3e4face079 Better support for BOOST_TYPEOF_NESTED_TYPEDEF for Borland
[SVN r39707]
2007-10-05 14:32:04 +00:00
Peder Holt 86d4e1c4db typeof support for template template arguments for Borland 5.9.2 (also used for Borland 5.8.2) (reverted to old scheme for other compilers)
[SVN r39704]
2007-10-05 12:39:15 +00:00
Peder Holt cbdff442ad Update typeof emulation to support Borland 5.9.2
[SVN r39691]
2007-10-05 07:06:13 +00:00
Peder Holt f576bcf847 Modified tests to account for Borland compiler
[SVN r39590]
2007-09-28 20:11:32 +00:00
Peder Holt e2dc6c246a Implement typeof emulation for the Borland compiler. Tested with Borland 5.8.2
[SVN r39589]
2007-09-28 20:09:01 +00:00
6 changed files with 16 additions and 101 deletions
+12 -3
View File
@@ -104,7 +104,7 @@ namespace boost
typedef T type;
};
};
#elif BOOST_WORKAROUND(BOOST_MSVC,==1400)
#elif BOOST_WORKAROUND(BOOST_MSVC,>=1400)
struct msvc_extract_type_default_param {};
template<typename ID, typename T = msvc_extract_type_default_param>
@@ -153,7 +153,7 @@ namespace boost
};
};
# endif
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
# if BOOST_WORKAROUND(BOOST_MSVC,==1310)
template<const std::type_info& ref_type_info>
struct msvc_typeid_wrapper {
typedef typename msvc_extract_type<msvc_typeid_wrapper>::id2type id2type;
@@ -184,6 +184,7 @@ namespace boost
template<typename Organizer, typename T>
msvc_register_type<T,Organizer> typeof_register_type(const T&);
# define BOOST_TYPEOF(expr) \
boost::type_of::msvc_typeid_wrapper<typeid(boost::type_of::encode_start(expr))>::type
@@ -239,10 +240,18 @@ struct name {\
{
typedef char(*type)[encode_type<T>::value];
};
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
template<typename T> typename disable_if<
typename is_function<T>::type,
typename sizer<T>::type>::type encode_start(T const&);
template<typename T> typename enable_if<
typename is_function<T>::type,
typename sizer<T>::type>::type encode_start(T&);
# else
template<typename T>
typename sizer<T>::type encode_start(T const&);
# endif
template<typename Organizer, typename T>
msvc_register_type<T,Organizer> typeof_register_type(const T&,Organizer* =0);
+4 -1
View File
@@ -138,9 +138,12 @@ namespace boost { namespace type_of {
namespace boost { namespace type_of {
# if BOOST_TYPEOF_LIMIT_SIZE < 50
template<class V, class T> struct push_back {
typedef V type;
}; //default behaviour is to let push_back ignore T, and return the input vector.
};
# endif
//default behaviour is to let push_back ignore T, and return the input vector.
//This is to let BOOST_TYPEOF_NESTED_TYPEDEF work properly with the default vector.
# define BOOST_PP_LOCAL_MACRO BOOST_TYPEOF_spec_push_back
# define BOOST_PP_LOCAL_LIMITS \
-26
View File
@@ -1,26 +0,0 @@
template<typename ID>
struct msvc_extract_type
{
template<bool>
struct id2type_impl;
typedef id2type_impl<true> id2type;
};
template<typename T, typename ID>
struct msvc_register_type : msvc_extract_type<ID>
{
template<>
struct id2type_impl<true> //VC7.0 specific bugfeature
{
typedef T type;
};
};
int main() {
sizeof(msvc_register_type<double,int>);
typedef msvc_extract_type<int>::id2type::type deduced_type;
deduced_type f=5.0;
return 0;
}
-39
View File
@@ -1,39 +0,0 @@
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>
{
};
int main() {
sizeof(msvc_register_type<double,int>);
typedef msvc_extract_type<int>::id2type::type deduced_type;
deduced_type f=5.0;
return 0;
}
-23
View File
@@ -1,23 +0,0 @@
template<typename ID>
struct msvc_extract_type
{
struct id2type;
};
template<typename T, typename ID>
struct msvc_register_type : msvc_extract_type<ID>
{
typedef msvc_extract_type<ID> base_type;
struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature
{
typedef T type;
};
};
int main() {
sizeof(msvc_register_type<double,int>);
typedef msvc_extract_type<int>::id2type::type deduced_type;
deduced_type f=5.0;
return 0;
}
-9
View File
@@ -1,9 +0,0 @@
#include <typeinfo>
template<const std::type_info& info>
struct msvc_register_type {
};
int main() {
msvc_register_type<typeid(double)>;
}