forked from boostorg/typeof
support enum, dependent template parameters
[SVN r2444]
This commit is contained in:
1 parent
a330151f32
commit
9e10362252
5 files changed
+107
-95
No files matched your search
@@ -62,4 +62,54 @@ void test_spirit2()
|
||||
throw 0;
|
||||
}
|
||||
|
||||
#pragma message("compiling integral param wrapper...")
|
||||
|
||||
namespace test_integral
|
||||
{
|
||||
// Enum template parameter
|
||||
enum E{ONE, TWO, THREE};
|
||||
|
||||
template<E e> struct foo
|
||||
{
|
||||
static const E value = e;
|
||||
};
|
||||
|
||||
// dependent template parameter
|
||||
template<class T, T n> struct bar
|
||||
{};
|
||||
|
||||
// multi-word template parameter
|
||||
template<unsigned long int n> struct blah
|
||||
{};
|
||||
}
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(test_integral::foo,
|
||||
(BOOST_TYPEOF_INTEGRAL(test_integral::E))
|
||||
);
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(test_integral::blah,
|
||||
(BOOST_TYPEOF_INTEGRAL(unsigned long int))
|
||||
);
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(test_integral::bar,
|
||||
(class)
|
||||
(BOOST_TYPEOF_INTEGRAL(P0))
|
||||
);
|
||||
|
||||
namespace test_integral
|
||||
{
|
||||
void test()
|
||||
{
|
||||
foo<TWO> x;
|
||||
bar<int, 5> xx;
|
||||
blah<5> xxx;
|
||||
|
||||
BOOST_AUTO(y, x);
|
||||
BOOST_AUTO(yy, xx);
|
||||
BOOST_AUTO(yyy, xxx);
|
||||
|
||||
y;
|
||||
yy;
|
||||
yyy;
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,9 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="C:\boost\boost_1_32_0;"C:\ark\boost-sandbox\boost-sandbox""
|
||||
AdditionalIncludeDirectories="C:\boost\boost_1_32_0;..\..\..\.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
g++ -IC:\boost\boost_1_32_0 -I..\..\..\.. -D BOOST_TYPEOF_COMPLIANT -D BOOST_TYPEOF_LIMIT_SIZE=50 -D BOOST_MPL_LIMIT_VECTOR_SIZE=50 odr1.cpp odr2.cpp test_compliant.cpp ..\main.cpp
|
||||
g++ -IC:\boost\boost_1_32_0 -I..\..\..\.. -D BOOST_TYPEOF_COMPLIANT -D BOOST_TYPEOF_LIMIT_SIZE=50 -D BOOST_MPL_LIMIT_VECTOR_SIZE=50 test_compliant.cpp ..\main.cpp odr1.cpp odr2.cpp
|
||||
g++ -IC:\boost\boost_1_32_0 -I..\..\..\.. odr1.cpp odr2.cpp test_compliant.cpp ..\main.cpp
|
||||
|
||||
Reference in new issue
Block a user