File: cppversion.cpp

package info (click to toggle)
fritzing 0.9.6%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 39,128 kB
  • sloc: cpp: 103,072; ansic: 2,615; xml: 2,067; python: 803; sh: 253; makefile: 21
file content (19 lines) | stat: -rw-r--r-- 455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

/*
  A quick compile test to verify that certain C++ features are supported
 */

template<typename T>
constexpr T pi = T(3.1415926535897932385);

void testCppVersion() {
    int i = 1;
    int& r = i;
    auto ar = r;                                // int, nicht: int&
    decltype(r) dr = r;                         // int& C++11/14
    decltype(auto) dra = r;                     // int& C++14


    std::cout << 0b0001'0000'0001;
}