make_array.cpp 482 B

12345678910111213141516171819
  1. /*
  2. * Demonstrates make_array and to_array
  3. * */
  4. #include <cxxomfort/array.hpp>
  5. #include <cxxomfort/library/type_name.hpp>
  6. #include <cxxomfort/ostream.hpp>
  7. #include <string>
  8. #include <iostream>
  9. static_assert (CXXO_IF___cpp_feature(__cpp_decltype), "test requires decltype");
  10. int main () {
  11. using namespace std;
  12. auto arr= cxxomfort::make_array<int>(1, 2, 3, 4, 5) ;
  13. std::cout << "Returns: ";
  14. std::cout << cxxomfort::type_name<decltype(arr)>()<< endl;
  15. }