Is it possible to call templated user-defined conversion operator with explicit template arguments?

前端 未结 2 380
死守一世寂寞
死守一世寂寞 2021-01-22 01:21

Lets consider the following code (compiles successfully with clang++ 7.0.0, compiler arguments are -std=c++17 -Wall -Wextra -Werror -pedantic-errors):

2条回答
  •  猫巷女王i
    2021-01-22 01:34

    I understand that this question is for advanced scenari and is asking if the code is compliant with the standard but let's take a step back here for a second:

    Operator conversion is design to define "static-cast-like" operation. It doesn't really make sense to make a static cast depend on another templated type

提交回复
热议问题