我正在使用C++创建一个字符串类.我希望该类只接受数据类型char和wchar_t,我希望编译器在编译期间使用#error捕获任何无效的数据类型.我不喜欢使用assert().我怎样才能做到这一点?
c++ error-handling templates
c++ ×1
error-handling ×1
templates ×1