I have some constexpr
functions that allow me to simply change the behavior of my algorithm. The functions deduce their return values from some variables. A minimal example looks like this:
// A.h
constexpr std::array<int,3> a = {1,2,3};
constexpr int Foo() {return a[1]*a[2];}
constexpr int Bar() {return a[3];}
Now, all this is implemented in a header file, because I want the methods to be inlined. However, I do not want to expose a
to anyone including A.h
. How can I achieve this?