I try do that:
file.h
namespace {
void fun();
const bool nevermind = Register( fun );
}
file.cpp
namespace {
void fun() {
do_some_job();
}
}
Having linking error. Function void fun() is not found by linker.
If I try do that:
file.h
namespace {
void fun() {
do_some_job();
}
const bool nevermind = Register( fun );
}
all goes ok.
How compile first case? I don't want have function definition in *.h file.