Template argument deduction bug (?) - by svenschmidt75

Status : 


Sign in
to vote
ID 790270 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 6/16/2013 10:29:27 AM
Access Restriction Public


There might be a t.a.d. bug in the call to foo:

#include <type_traits>

class Vector {


template<typename VECTOR_EXPR1, typename VECTOR_EXPR2, typename BINOP>
class VectorBinaryExpr {
    VectorBinaryExpr(VECTOR_EXPR1 const & lhs, VECTOR_EXPR2 const & rhs) {}

template<typename EXPR>
struct expression_traits {
    typedef std::false_type is_vector_expression;

struct expression_traits<Vector> {
    typedef std::true_type is_vector_expression;

template<typename T1, typename T2>
typename std::enable_if<
    VectorBinaryExpr<T1, T2, double>

foo(T1 lhs, T2 rhs)
    return VectorBinaryExpr<T1, T2, double>(lhs, rhs);

int main(int argc, char* argv[])
    Vector v1;
    Vector v2;

    foo(v1, v2);

    return 0;
Sign in to post a comment.
Posted by Microsoft on 7/9/2013 at 11:23 PM
We've also provided a workaround. See the workarounds tab.
Posted by Microsoft on 7/9/2013 at 11:22 PM
Hi s-schmidt,

Thank you for taking the time to provide your feedback. After reviewing your reported issue, in the context of all the issues reported to us, we have decided not to take any action on this feedback at this time. We will re-consider our decision for a future release.

If this issue is severe, causing critical business situations or blocking your product development or deployment, please go to http://support.microsoft.com or call 1-800-MICROSOFT for assistance.
For Microsoft premier customers, please contact your administrator, your Technical Account Manager, or your Microsoft premier account representative.

Karl Niu
Posted by Microsoft on 6/16/2013 at 8:06 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 6/16/2013 at 10:52 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)