Suppose I have a library that declares a function that returns a type of const :
class Foo { ... }; const Foo makeFoo();
Now I want to remove const from makeFoo() of the return type (see my previous question ). I can remove const from both the header and cpp file, rebuild the library, and link my code to the new library. However, I also have old code dynamically linked to this library, and I want it to continue to work with the new version of the library.
So the first question is, does const remove the return break ABI from the type?
Second question: the actual code is completely different: this is a template class that has a static member function and which is subsequently explicitly created:
// fooMaker.h template<class Foo> class FooMaker { public: static const Foo make(); }; // fooMaker.cpp template<class Foo> const Foo FooMaker<Foo>::make() { ... } template class FooMaker<Foo1>; template class FooMaker<Foo2>;
Has anything changed?
If this is important, I use g ++ under linux.
c ++ abi const
Petr
source share