#include #include #include #include #include #include using namespace std; template class GetContainerType; template class GetContainerType> { public: GetContainerType() { std::cout << " vector " << std::endl; } using type = T; }; template class GetContainerType> { public: GetContainerType() { std::cout << " list " << std::endl; } using type = T; }; //萃取出数组元素个数 template class GetContainerType{ public: using type = T; static const std::size_t size = Size; }; int main() { std::cout << typeid(GetContainerType>::type).name() <::type).name() << std::endl; std::cout << GetContainerType::size << std::endl; return 0; }
上一篇 [Python语言程序设计]Python 课程作业 1
下一篇 C语言实现一个Shell(ShellLab)
版权所有 (c)2021-2022 MSHXW.COM
ICP备案号:晋ICP备2021003244-6号