Rootcint cannot find template functions

Hello, I have declared these template functions:

template <typename T>
std::map<T, SH::SampleHandler> map_meta(const SH::SampleHandler & sh, const std::string & key)
template <typename T>
std::set<T> meta_list(const SH::SampleHandler & sh, const std::string & key)

and my linkdef has:

#pragma link C++ function meta_list<std::string>(const SH::SampleHandler &, const std::string &);
#pragma link C++ function meta_list<double>(const SH::SampleHandler &, const std::string &);

#pragma link C++ function map_meta<std::string>(const SH::SampleHandler &, const std::string &);
#pragma link C++ function map_meta<double>(const SH::SampleHandler &, const std::string &);

when running rootcint I get:

Running rootcint
Warning: #pragma link, function meta_list<std::string>(const SH::SampleHandler&,const std::string&) not found ./../Root/LinkDef.h:10:
Warning: #pragma link, function map_meta<std::string>(const SH::SampleHandler&,const std::string&) not found ./../Root/LinkDef.h:13:

Why do I have this problem?

Hi,

Try without the std::#pragma link C++ function meta_list<string>(const SH::SampleHandler &, const string &);

Cheers,
Philippe.

[quote=“pcanal”]Hi,

Try without the std::#pragma link C++ function meta_list<string>(const SH::SampleHandler &, const string &);

Cheers,
Philippe.[/quote]

yes, thank you, now it works. Now: why do I have to remove std::? Can you fix it?

Hi,

This is a vaguery of the CINT type database and lookup implementation. So, yes we are fixing it by moving to Cling (and won’t fix it in ROOT 5).

Cheers,
Philippe.