I have next class and try to declare member function which will return pointer to a that type but next code
template<class Key, int b> class b_plus_tree_inner_node {
auto split() -> decltype(this) {}
};
gives me such error
invalid use of ‘this’ at top level
can i do it in another way, i now about existence of typedef, but may be its possible with decltype?
EDITED:
i want to accomplish this:
b_plus_tree_inner_node<Key, b>* split() {...}
If you want a member function declare it inside the class:
If you want a non-member function, make it a template:
The standard does allow you to write
auto split() -> decltype(this) {}but GCC 4.6 doesn’t support it yet (the trunk of GCC 4.7 does).