Alf said:
* (e-mail address removed):
// External linkage
void a() {}
aren't members declared at file scope static implicitly? So even if
void a() {} has external linkage, something like
int x;
should will be static and hence will have internal linkage.
// External linkage
inline void b() {}
Here I am confused. Lakos mentions that inline functions have internal
linkage (1.1.2, pg 24). Why should the above example have external
linkage then?
// External linkage
extern void c() {}
undertood
// External linkage
extern inline void d() {}
Again, why? What is the difference between extern inline void d() {}
and inline void() d{} if they both have external linkage?
// External linkage
struct Foo1{ static void e(); };
void Foo1::e() {}
wow is there a quick way of determining or these have to be memorized?
// External linkage
struct Foo2{ static void f() {} };
well, here static void f() {} is inline as it is also defined where it
is declared in the struct. Lakos mentions that this too should have
internal linkage.
// External linkage
struct Foo3{ void g(); }
void Foo3::g() {}
// External linkage
struct Foo4{ void h() {} }
// Internal linkage
static void i() {}
// Internal linkage
static inline void j() {}
void aFunction()
{
// No linkage.
struct aStruct
{
...
};
}
Summing up, 'inline' is orthogonal to extern/internal linkage.
what does that mean?
However, 'inline' places an extra requirement, that of identical
definitions in different translation units, on a function with extern
linkage.
I don't think there's any case of ambigious linkage.
thanks, but I was only wondering how inline can have internal linkage
or external