I am playing around with some toy code using c++11 to figure out a bit more about how things work. During this I came across the following issue that simplifies down to:
If your purpose is just to shorten code a bit, in C++14 you can create variable template:
template constexpr int addVar = x + y; cout << addVar<5, 6> << endl; // Works with clang 3.5, fails on GCC 4.9.1
GCC 5 will also support this.