Compare commits

..

8 Commits

Author SHA1 Message Date
Nicola Musatti
55d1339dd4 bcbboost branch rebased on current release
[SVN r49389]
2008-10-19 14:43:01 +00:00
Nicola Musatti
d7a097c705 Patches for Codegear C++ Builder 2009
[SVN r48981]
2008-09-27 08:59:20 +00:00
Tobias Schwinger
7d3afd076d removes unnecessary escaping
[SVN r43411]
2008-02-25 11:45:51 +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
Nicola Musatti
b9282a9672 Merge from trunk
[SVN r39987]
2007-10-13 21:25:29 +00:00
Nicola Musatti
b0934ae746 Merge from trunk
[SVN r39768]
2007-10-07 20:10:53 +00:00
Nicola Musatti
6c8378110f Merge from trunk
[SVN r39594]
2007-09-29 14:51:39 +00:00
Nicola Musatti
d2c6a52631 Branch for CodeGear (Borland) specific fixes
[SVN r39356]
2007-09-17 20:28:43 +00:00
4 changed files with 97 additions and 0 deletions

26
test/experimental_1.cpp Executable file
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
test/experimental_2.cpp Executable file
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
test/experimental_3.cpp Executable file
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
test/experimental_4.cpp Executable file
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)>;
}