Listing 6
template<typename T> struct optimize { enum { T_size_ = sizeof(T) , base_size_ = sizeof(object_holder) , size_ok_ = (T_size_ <= base_size_) , value = size_ok_ }; }; template<typename T> struct table { enum { optimized = sizeof(T) <= sizeof(object_holder) }; static fxn_ptr_table* get() { static fxn_ptr_table static_table = { &fxns<optimized>::template impl<T>::type , &fxns<optimized>::template impl<T>::destructor , &fxns<optimized>::template impl<T>::static_delete , &fxns<optimized>::template impl<T>::clone , &fxns<optimized>::template impl<T>::assign , &fxns<optimized>::template impl<T>::is_optimized , &fxns<optimized>::template impl<T>::swap }; return &static_table; } };