Posts

Showing posts with the label using

Define members of a class using class's namespace in c++

Image
Clash Royale CLAN TAG #URR8PPP Define members of a class using class's namespace in c++ I have few classes with long names as well as their member functions. In C++ there is a trick which allows you to use one namespace and turn: namespace_name::foo() into using namespace namespace_name; foo() For clarity of the code I'm wondering if there is a similar way to substitute definitions of functions: LongClassName::LongFunctionName() {} I'm sorry if I used improper vocabulary, but had no idea how to describe the problem. How about LongClassName son; /* son = show object name */ son.LongFunctionName(); ? At least a part of the "long" name have been shortened. – Some programmer dude 12 mins ago LongClassName son; /* son = show object name */ son.LongFunctionName(); using ShortName = LongName; ...