随笔分类 - C++
摘要:正好在实现一个Vector2类型: template<typename T> struct Vector2; template<typename T> Vector2<T> operator+(const Vector2<T>& v1, const Vector2<T>& v2); template
阅读全文
摘要:虚析构函数是可以声明的,这意味着需要由于子类来实现接口的析构函数。 reference: https://blog.csdn.net/wufeifan_learner/article/details/88804072 class A{ public: A(){ cout<<"构造函数A"<<endl
阅读全文
摘要:template < typename TO, typename FROM > inline TO union_cast( FROM value ) { union { FROM from; TO to; } convert; convert.from = value; return convert
阅读全文
摘要:Link to StackOverflow: Why does the C++ map type argument require an empty constructor when using [] by Nick Bolton? Q: Not a major issue, just annoyi
阅读全文
摘要:If only member function _clear_ of _WindowMgr_ is a friend of _Screen_, there are some points need to note. Sequence is important. First, define the _
阅读全文
摘要:About why inline member function should defined in the header file. It is legal to specify inline on both the declaration and the definition. But the
阅读全文

浙公网安备 33010602011771号