Menu

Syntax error in template class

Robert
2021-02-05
2021-02-05
  • Robert

    Robert - 2021-02-05

    Hi,

    I get a syntax error on the following code

    template<class T>
    class matrix {
        template <class U = T,
                  class std::enable_if<std::is_trivial<U>::value && std::is_standard_layout<U>::value>::type* = nullptr>
        matrix<T> clone(bool a_SelectionOnly=true) const;  // creates a deep copy
    }
    

    matrix.cpp:4:64: error: SymbolDatabase bailout; unhandled code [syntaxError]
    class std::enable_if<std::is_pod<u>::value>::type* = nullptr></std::is_pod<u>

     
  • Robert Reif

    Robert Reif - 2021-02-05

    This gets tokenized wrong:

    1: template < class T >
    2: class matrix {
    3: template < class U = T ,
    4: class std :: enable_if < std :: is_trivial < U > :: value && std :: is_standard_layout < U > :: value > :: type *= nullptr >
    5: matrix < T > clone ( bool a_SelectionOnly = true ) const ;
    6: } ;
    

    * = gets tokenized to *= on line 4

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.