Skip to content
Snippets Groups Projects
  • Carsten Gräser's avatar
    30af32f6
    Remove overload for staticSize · 30af32f6
    Carsten Gräser authored
    This fails to compile if you cannot instanciate the default
    constructor T.
    
    The problem showed up with a std::tuple<T> where T is
    not default constructible. This is a really nasty issue:
    std::tuple<T> implements a default constructor but
    instanciating this fails in this case.
    
    As a consequence std::is_constructible<std::tuple<T>> is
    true, but trying to instanciate it gives a compile error.
    Similar behaviour can be observed with operator<.
    At least for the default constructor of std::tuple
    this seems to be fixed in C++17 by removing it from the
    overload set if you can't instanciate one for T.
    30af32f6
    History
    Remove overload for staticSize
    Carsten Gräser authored
    This fails to compile if you cannot instanciate the default
    constructor T.
    
    The problem showed up with a std::tuple<T> where T is
    not default constructible. This is a really nasty issue:
    std::tuple<T> implements a default constructor but
    instanciating this fails in this case.
    
    As a consequence std::is_constructible<std::tuple<T>> is
    true, but trying to instanciate it gives a compile error.
    Similar behaviour can be observed with operator<.
    At least for the default constructor of std::tuple
    this seems to be fixed in C++17 by removing it from the
    overload set if you can't instanciate one for T.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.