Is there a way to define a constant using function from another method and #define?
For example, I have in file foo.cpp a method that returns an int:
int foo() { return 2; }
In my bar.cpp, I want to have something like
#define aConstant foo()
Is it possible? Is there a way to do it?
(I’m using Visual Studio 2010)
EDIT: constexpr doesn’t work since I’m using VS 2010, so any other idea?
Make it
Then in the other unit