Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename TReturn, typename... TArgs>
- class ClassX<TReturn(TArgs...)> : public Internal::ClassXImpl<TReturn, TArgs...> {
- public:
- using BaseTypeX = Internal::ClassXImpl<TReturn, TArgs...>;
- using BaseTypeX::BaseTypeX; // what is this doing exactly?
- inline ClassX() noexcept = default;
- // member function
- template<class TThis, class TFunc>
- inline ClassX(TThis* aThis, TFunc aFunc) {
- this->bind(aThis, aFunc); // note bind is implemented in the ClassXImpl class
- }
- struct Foo
- {
- Foo(int);
- Foo(int, double);
- Foo(std::string);
- };
- struct Bar : Foo
- {
- using Foo::Foo;
- };
- int main()
- {
- Bar b1(42); // OK, Foo's constructors have been "inherited"
- Bar b2(42, 3.14); // OK too
- Bar b2("hello"); // OK
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement