Lib: fix warning regarding subobject-linkage

And yes, this warning is for real, while the compiler has no way
to decide if there is actual danger lurking. A type with internal
linkage (e.g. defined in an anonymous namespace) will be treated
by the linker as a separate entity on each encounter (i.e. in
each distinct compilation unit). When multiple translation units
start collaborating on such a type, they *might* be referring
to different memory locations, while semantically the intention
is to refer to the same location.

And since we're dealing with a library facility here, *we* have
likewise now power to ensure proper usage, so we better be cautious.
This commit is contained in:
Fischlurch 2016-12-25 20:09:24 +01:00
parent 3501732839
commit 387a553e98

View file

@ -66,7 +66,7 @@
namespace lib {
namespace {
namespace iter {
using util::unConst;
/**
@ -100,7 +100,7 @@ namespace lib {
elements.pop_back();
}
};
}//(End) Wrapper/Helper
} // namespace lib::iter
@ -118,7 +118,7 @@ namespace lib {
*/
template<class TY>
struct IterStack
: IterStateWrapper<TY, IterDequeStorage<TY>>
: IterStateWrapper<TY, iter::IterDequeStorage<TY>>
{
// using default create and copy operations
@ -165,7 +165,7 @@ namespace lib {
*/
template<class TY>
struct IterQueue
: IterStateWrapper<TY, IterDequeStorage<TY>>
: IterStateWrapper<TY, iter::IterDequeStorage<TY>>
{
// using default create and copy operations