Compare commits

..

3 Commits

Author SHA1 Message Date
Daniel James d5c39b3615 Merge with the offending files removed.
[SVN r39995]
2007-10-13 23:18:35 +00:00
Daniel James 39361d0ac9 Merge from trunk.
[SVN r39287]
2007-09-14 22:24:22 +00:00
Daniel James 5fcc3c4cfd Create a development branch for the hash library.
[SVN r38869]
2007-08-23 19:28:19 +00:00
5 changed files with 98 additions and 4 deletions
+1 -4
View File
@@ -138,12 +138,9 @@ 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;
};
# endif
//default behaviour is to let push_back ignore T, and return the input vector.
}; //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
@@ -0,0 +1,26 @@
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
@@ -0,0 +1,39 @@
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
@@ -0,0 +1,23 @@
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
@@ -0,0 +1,9 @@
#include <typeinfo>
template<const std::type_info& info>
struct msvc_register_type {
};
int main() {
msvc_register_type<typeid(double)>;
}