11 lines · c
1template <typename T>2struct Box {3 T value;4 5 const T& get_value() const { return value; }6 const T* get_ptr() const { return &value; }7};8 9using FloatBox = Box<float>;10using IntBox = Box<int>;11 1template <typename T>2struct Box {3 T value;4 5 const T& get_value() const { return value; }6 const T* get_ptr() const { return &value; }7};8 9using FloatBox = Box<float>;10using IntBox = Box<int>;11