61 verify_genericTypeDisplay();
63 detect_stringConversion();
79 CHECK (
sizeof(
Yes_t) ==
sizeof (probe (1)));
80 CHECK (
sizeof(
Yes_t) ==
sizeof (probe (1L)));
81 CHECK (
sizeof(
Yes_t) ==
sizeof (probe (
'a')));
82 CHECK (
sizeof(
No_t) ==
sizeof (probe (
"a")));
85 static Yes_t probe (
int);
86 static No_t probe (...);
91 verify_genericTypeDisplay()
93 cout << typeStr<SubString>() <<endl;
98 virtual void run (Arg) {}
101 cout <<
typeStr(lunatic) << endl;
102 cout <<
typeStr(&lunatic) << endl;
103 cout <<
typeStr((Test &)lunatic) << endl;
104 cout <<
typeStr((Test *) &lunatic) << endl;
105 cout <<
typeStr(&Lunatic::run) << endl;
121 operator string() {
return "No such thing"; }
132 template<
typename TY>
134 can_convert (TY
const&)
140 detect_stringConversion()
142 CHECK ( can_convert (
string(
"inline string")));
143 CHECK ( can_convert (
"char literal"));
144 CHECK (!can_convert (23.34));
145 CHECK (!can_convert (23));
146 CHECK (!can_convert (1L));
149 string & str_ref (str);
150 string const& str_const_ref (str);
151 string * str_ptr = &str;
153 CHECK ( can_convert (str));
154 CHECK ( can_convert (str_ref));
155 CHECK ( can_convert (str_const_ref));
156 CHECK ( can_convert (*str_ptr));
157 CHECK (!can_convert (str_ptr));
165 CHECK ( can_convert (sub));
166 CHECK (!can_convert (thing));
167 CHECK ( can_convert (stringy));
168 CHECK ( can_convert (subsub));
169 CHECK ( can_convert (subRef));
A template metaprogramming technique for manipulating collections of types.
Implementation namespace for support and library code.
Simple test class runner.