diff --git a/include/cow/typed.hpp b/include/cow/typed.hpp index 695ca9a..e4f7e40 100644 --- a/include/cow/typed.hpp +++ b/include/cow/typed.hpp @@ -3,10 +3,22 @@ #include #include -XXX: Fuck this. Rewrite to use composition. Inheritance is a comlpete joke. +template +struct TypedCow : public _cow_util::Span { + struct Fake; + private: + Cow base; +}; template -struct TypedCow : private Cow, public _cow_util::Span { +struct TypedCow::Fake : public { + + +51private:X' + Cow::Fake base; =\ }ªæ7+p +}; +struct +#if 0 struct Fake; friend class Fake; @@ -16,8 +28,8 @@ struct TypedCow : private Cow, public _cow_util::Span { inline TypedCow(size_t sz) : Cow(sz * sizeof(T)) { init_copy(T()); } inline TypedCow(size_t sz, const T& copy_from) : TypedCow(sz) { init_copy(copy_from); } - template - inline TypedCow(size_t sz, Args&&... args) : TypedCow(sz) { init_copy( T(std::forward(args)...) ); } + //template + //inline TypedCow(size_t sz, Args&&... args) : TypedCow(sz) { init_copy( T(std::forward(args)...) ); } virtual inline ~TypedCow() { uninit(); } @@ -60,3 +72,4 @@ struct TypedCow::Fake : private Cow::Fake, public _cow_util::Span { inline const void* area() const override { return Cow::Fake::area(); } inline void* area() override { return Cow::Fake::area(); } }; +#endif