std::function as template parameter

前端 未结 2 1688
后悔当初
后悔当初 2021-02-07 12:35

I currently have a map, but for flexibility, I want to be able to assign a lambda expression, returning std::wstring as value

2条回答
  •  温柔的废话
    2021-02-07 13:00

    Both std::function and std::wstring have conversion operators that could take the literal wide string you are passing. In both cases the conversions are user defined and thus the conversion sequence takes the same precedence, causing the ambiguity. This is the root cause of the error.

提交回复
热议问题