File: cppversion.cpp

package info (click to toggle)
fritzing 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 42,144 kB
  • sloc: cpp: 98,203; xml: 2,203; python: 803; sh: 274; ansic: 26; makefile: 22
file content (22 lines) | stat: -rw-r--r-- 535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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

    (void)ar; // prevent unused variable warnings
    (void)dr;
    (void)dra;

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