0

In python I can do:
from long_and_painful import still_way_to_long as short

In C++ I am stuck with:

using long::and::painful::stillWayToLong;
... //Code and Stuff
stillWayToLong("Why must I type this so often?");

Am I missing something that would make this more pythonic?

user124950
  • 23
  • 3

1 Answers1

1

How about

auto x = long::and::painful::stillWayToLong;  // If this is an object/function
x("Why must I type this so often?");


using X = typename long::and::painful::stillWayToLong; // If this is a type.
X bob;
Martin York
  • 257,169
  • 86
  • 333
  • 562
  • 1
    And for the sake of completeness `using x = long::and::painful::stillWayToLong;` if `stillWayTooLong` is a namespace. – dgnuff Jul 19 '18 at 00:51