Skip to content
Snippets Groups Projects
Forked from Core Modules / dune-common
Source project has a limited visibility.
  • Markus Blatt's avatar
    bd498e0d
    [g++-4.4] Fixes missing std::initializer_list::const_iterator for g++-4.4. · bd498e0d
    Markus Blatt authored
    With g++-4.4 I got the following errors:
    
    fmatrix.hh:106: error: no type named ‘const_iterator’ in ‘class std::initializer_list<std::initializer_list<int> >’
    
    Looking into the header there is indeed the const_iterator (demanded by the standard)
    missing. Therefore I refactored the code to use std::copy_n and thus am omitting the iterator
    type.
    
    At the same time I made the actual copying safer for the case that the initializer_list
    is of different size and people compile with -DNDEBUG. The assertion for the size is still
    left in there. Remove the assert or the size computation at your discretion.
    bd498e0d
    History
    [g++-4.4] Fixes missing std::initializer_list::const_iterator for g++-4.4.
    Markus Blatt authored
    With g++-4.4 I got the following errors:
    
    fmatrix.hh:106: error: no type named ‘const_iterator’ in ‘class std::initializer_list<std::initializer_list<int> >’
    
    Looking into the header there is indeed the const_iterator (demanded by the standard)
    missing. Therefore I refactored the code to use std::copy_n and thus am omitting the iterator
    type.
    
    At the same time I made the actual copying safer for the case that the initializer_list
    is of different size and people compile with -DNDEBUG. The assertion for the size is still
    left in there. Remove the assert or the size computation at your discretion.