V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
shylockhg
V2EX  ›  问与答

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

  •  1
     
  •   shylockhg · Aug 19, 2020 · 1635 views
    This topic created in 2089 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   ·   5339 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 07:55 · PVG 15:55 · LAX 00:55 · JFK 03:55
    ♥ Do have faith in what you're doing.