Hi All,

I want to use log_init() in a template.


At the moment the header looks like:

namespace xyz
{
log_define("xyz")

template<typename T> struct CfgValue
{
/// it in the configuration textfile
std::string mFieldId;
/// value in the configuration file
T mValue;

CfgValue(const std::string &fieldId) : mFieldId(fieldId)
{;}

T& operator()()
{
return mValue;
}

void dump() const
{
log_info(mFieldId << ": " << mValue);
}
};
}

But log_define() should be used in the cpp file, only. Othewise you get 
some message like:

error: ‘cxxtools::Logger* lccpc::getLogger()’ previously defined here

I tried to move dump() into a cpp file but then the linker was not be 
able not find it.


Any suggestions?

Andreas




------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to