Use builtin C++ feature tests to check availability of language features

Submitted by Christoph Hertzberg @chhtz

Assigned to Nobody

Link to original bugzilla bug (#1764)
Version: 3.5 (future version)

Description

A lot of the relatively complicated feature detection code could be simplified by using built-in feature-tests of C++, e.g.,

// Does the compiler support variadic templates?  
#ifndef EIGEN_HAS_VARIADIC_TEMPLATES  
  #if EIGEN_MAX_CPP_VER>=11 && defined(__cpp_variadic_templates)  
    #define EIGEN_HAS_VARIADIC_TEMPLATES __cpp_variadic_templates  
  #else  
    #define EIGEN_HAS_VARIADIC_TEMPLATES 0  
  #endif  
#endif  

This needs to be tested with older compiler however, and we either need to still add some extra tests, or just un-support compilers which do not support these feature-tests.

https://en.cppreference.com/w/cpp/feature_test

Blocking

#1683 (closed)

Edited by Eigen Bugzilla