//筆記 實現** 僅摘取一部分 理解原理 不是完整的boost**
// 依賴的標頭檔案
// #include or #include // 實現原理
template struct add_const
;template struct add_const;
// add_const::type => int const
// add_const::type => int&
// add_const::type => int* const
// add_const::type => int const
// 依賴的標頭檔案
// #include or #include template struct add_cv;
template struct add_cv;
// add_cv::type => int const volatile
// add_cv::type => int&
// add_cv::type => int* const volatile
// add_cv::type => int const volatile
// 依賴的標頭檔案
// #include or #include template struct add_reference_impl
;template struct add_reference_impl;
template struct add_reference
;template struct add_reference;
template <> struct add_reference;
template <> struct add_reference;
template <> struct add_reference;
template <> struct add_reference;
// add_reference::type => int&
// add_reference::type => int const&
// add_reference::type => int*&
// add_reference::type => int*&
// 依賴的標頭檔案
// #include or #include template struct add_volatile;
template struct add_volatile;
// add_volatile::type => int volatile
// add_volatile::type => int&
// add_volatile::type => int* volatile
// add_volatile::type => int const volatile
// 依賴的標頭檔案
// #include or #include template struct add_pointer
;template struct add_pointer;
template struct add_pointer;
template struct add_pointer;
template struct add_pointer;
// add_pointer::type => int*
// add_pointer::type => int const*
// add_pointer::type => int**
// add_pointer::type => int**
// 依賴的標頭檔案
// #include or #include template struct add_lvalue_reference
;template struct add_lvalue_reference;
// add_lvalue_reference::type => int&
// add_lvalue_reference::type => int const&
// add_lvalue_reference::type => int*&
// add_lvalue_reference::type => int*&
// add_lvalue_reference::type => int&
// add_lvalue_reference::type => void
// 依賴的標頭檔案
// #include or #include template struct add_rvalue_reference_helper
;template struct add_rvalue_reference_helper;
template struct add_rvalue_reference_imp
;template struct add_rvalue_reference
;// add_rvalue_reference::type => int&&
// add_rvalue_reference::type => int const&
// add_rvalue_reference::type => int*&&
// add_rvalue_reference::type => int*&
// add_rvalue_reference::type => int&&
// add_rvalue_reference::type => void
boost學習筆記之noncopyable
先來看乙個例子 include using namespace std class test public test cout test 如果在類中沒有顯式地宣告乙個拷貝建構函式,那麼,編譯器將會自動生成乙個預設的拷貝建構函式,該建構函式完成物件之間的位拷貝,位拷貝又稱淺拷貝。也就是說預設的c 類是...
boost 學習筆記
先來看看如何賦值把 include include include include include include include using namespace std int tmain int argc,tchar ar include include include include incl...
Boost學習筆記 operators
如果乙個類要實現operator operator 意味著可能也要實現operator operator 等其它操作符。只要提供了operator operator 就可以根據這兩個操作符實現operator operator 等其它操作符。而且這種實現是單調的 operator const t x...