Naming base-classes

67 views
Skip to first unread message

Peter Koch Larsen

unread,
Jun 29, 2016, 9:28:38 AM6/29/16
to ISO C++ Standard - Future Proposals
I often need to access the base-class, and this class is often templated. This causes minor annoyances and is a maintenance problem.

template <class T>
struct B {...};

template<class T>
struct D: B<T>
{
    using base = B<T>;
...

};

I often encounter this problem when B and D are traits-classes, providing information about the actual type T (where B and D might
contain information about the GUI-representation of T or how to transfer T using a specific protocol).

It would be nice if I could name the class e.g. like
template<class T>
struct D: base = B<T>
{
//    using base = B<T>;  Not needed anymore.
...

};

This solution looks nice to me syntax-wise, mimicking the using-directive, and should be rather easy to implement.

Has there been any proposals in this direction?

Best regards
Peter

Ville Voutilainen

unread,
Jun 29, 2016, 9:58:37 AM6/29/16
to ISO C++ Standard - Future Proposals
Reply all
Reply to author
Forward
0 new messages