shylockhg
V2EX  ›  问与答

变长模板参数同时匹配失败和匹配到空参数列表<>如何解决

  •  1
     
  •   shylockhg · Aug 19, 2020 · 1664 views
    This topic created in 2095 days ago, the information mentioned may be changed or developed.
    note: candidate function [with T = Type, V = Type, $2 = void]
    
    note: candidate function [with T = Type, V = Type, Vs = <>, $3 = void]
    

    如上所示 T 是 template, V 是 typename, Vs 是 typename...,如果用 func<T1, T2>的方式调用模板函数,会同时匹配到两个。。

    有大佬知道是什么问题么

    Supplement 1  ·  Aug 19, 2020
    函数签名
    ```cpp
    template <template <typename> class T, typename V, typename... Vs, typename = void>
    func(Expr* expr, V v, Vs&... vs)
    template <template <typename> class T, typename V, typename = void>
    func(Expr* expr, V& vs)
    ```
    2 replies    2020-08-19 17:39:55 +08:00
    MarshallMathers
        1
    MarshallMathers  
       Aug 19, 2020
    没有具体代码吗?
    shylockhg
        2
    shylockhg  
    OP
       Aug 19, 2020
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   896 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 20:31 · PVG 04:31 · LAX 13:31 · JFK 16:31
    ♥ Do have faith in what you're doing.