53 verify_genericTypeDisplay();
55 detect_stringConversion();
71 CHECK (
sizeof(
Yes_t) ==
sizeof (probe (1)));
72 CHECK (
sizeof(
Yes_t) ==
sizeof (probe (1L)));
73 CHECK (
sizeof(
Yes_t) ==
sizeof (probe (
'a')));
74 CHECK (
sizeof(
No_t) ==
sizeof (probe (
"a")));
77 static Yes_t probe (
int);
78 static No_t probe (...);
83 verify_genericTypeDisplay()
85 cout << typeStr<SubString>() <<endl;
90 virtual void run (Arg) {}
93 cout <<
typeStr(lunatic) << endl;
94 cout <<
typeStr(&lunatic) << endl;
95 cout <<
typeStr((Test &)lunatic) << endl;
96 cout <<
typeStr((Test *) &lunatic) << endl;
97 cout <<
typeStr(&Lunatic::run) << endl;
113 operator string() {
return "No such thing"; }
124 template<
typename TY>
126 can_convert (TY
const&)
132 detect_stringConversion()
134 CHECK ( can_convert (
string(
"inline string")));
135 CHECK ( can_convert (
"char literal"));
136 CHECK (!can_convert (23.34));
137 CHECK (!can_convert (23));
138 CHECK (!can_convert (1L));
141 string & str_ref (str);
142 string const& str_const_ref (str);
143 string * str_ptr = &str;
145 CHECK ( can_convert (str));
146 CHECK ( can_convert (str_ref));
147 CHECK ( can_convert (str_const_ref));
148 CHECK ( can_convert (*str_ptr));
149 CHECK (!can_convert (str_ptr));
157 CHECK ( can_convert (sub));
158 CHECK (!can_convert (thing));
159 CHECK ( can_convert (stringy));
160 CHECK ( can_convert (subsub));
161 CHECK ( can_convert (subRef));
A template metaprogramming technique for manipulating collections of types.
Implementation namespace for support and library code.
Marker types to indicate a literal string and a Symbol.
Simplistic test class runner.