On Donnerstag, 2. April 2020 01:36:40 CEST Aaron Puchert wrote:
Am 01.04.20 um 20:23 schrieb Pierre:
So, if I understand your comment, the code currently have
binarystoragebuffer.cc: inline void BinaryStorageBuffer::store (void* stream, unsigned int nb_bytes)
binarystoragebuffer.h: void store (void* stream, unsigned int nb_bytes);
Yes, that's a problem because of http://eel.is/c++draft/dcl.inline#5:
If a function or variable with external or module linkage is declared inline in one definition domain, an inline declaration of it shall be reachable from the end of every definition domain in which it is declared; no diagnostic is required.
The function is declared with (implicit) external linkage in the header file. Since binarystoragebuffer.cc (basically a "definition domain") contains an inline declaration, all other source files that include this header must have an inline declaration. That isn't satisfied.
No, your diagnosis is wrong. The .cc file does not have a *inline* declaration. The note above does not apply. void BinaryStorageBuffer::store (void* stream, unsigned int nb_bytes); is a declaration. void BinaryStorageBuffer::store (void* stream, unsigned int nb_bytes) {...} is a definition, but it may be also a declaration. 1. declared (and defined) inline: --- inline void foo(int); inline void foo(int) { return; } --- 2. also declared (and defined) inline: --- inline void foo(int) { return; } --- 3. not declared inline: --- void foo(int) { return; } --- 4. also not declared inline: --- void foo(int); inline void foo(int) { return; } --- Regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019