X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fmaputils.h;fp=source%2Fcore%2Fmaputils.h;h=0f863b46fdf7dea307f251be4823a4e63cdcbc4e;hp=8c642fb9c57a1f9acda6ba5ab2d0dc5311316306;hb=676f6faa92d23c2096a6a85cac819925dbdc1a88;hpb=e0266badf098a5cec2512eb693bca771e35fd3ab diff --git a/source/core/maputils.h b/source/core/maputils.h index 8c642fb..0f863b4 100644 --- a/source/core/maputils.h +++ b/source/core/maputils.h @@ -9,11 +9,17 @@ namespace Msp { namespace MapUtilsInternal { +/* This dummy struct is used to introduce a conversion, making the overloaded +operator below worse than the templated one provided in lexicalcast.h. */ +struct Any +{ + template + Any(const T &) { } +}; + /* This must be hidden in the internal namespace to avoid interfering with -other things. There may be problems if a key type has operator<< for ostream -but not LexicalConverter. */ -template -void operator<<(LexicalConverter &, const T &) +other things. */ +inline void operator<<(LexicalConverter &, Any) { } template