1 ::max() //调用全域命名空间中定义的max(),而不是std::max()
2 非类型模板参数MAXSIZE ,默认值100
template <typename T = int, int MAXSIZE = 100>
class Stack {
...
};
3
template <typename T>
class MyClass {
typename T::SubType * ptr; //typename 说明subType为T中非静态类型
...
};
4
void printBitset (std::bitset<N> const& bs)
{
std::cout << bs.template to_string<char,std::char_traits<char>,std::allocator<char> >();
}
怎么用这个