Project
Loading...
Searching...
No Matches
cxx14-test-user-defined-literals.cxx
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
17
18
#include <chrono>
19
#include <complex>
20
#include <string>
21
22
bool
testString
()
23
{
24
using namespace
std::literals;
25
auto
strl =
"hello world"
s;
26
std::string
str
=
"hello world"
;
27
if
(
str
.compare(strl) == 0) {
28
return
true
;
29
}
else
{
30
return
false
;
31
}
32
}
33
34
bool
testChrono
()
35
{
36
using namespace
std::chrono_literals;
37
auto
durl = 60s;
38
std::chrono::seconds dur(60);
39
return
(durl == dur);
40
}
41
42
bool
testComplex
()
43
{
44
using namespace
std::literals::complex_literals;
45
auto
zl = 1
i
;
46
std::complex<double>
z
(0, 1);
47
return
(zl ==
z
);
48
}
49
50
int
main
() {
return
(
testComplex
() &&
testString
() &&
testChrono
()) ? 0 : 1; }
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
testComplex
bool testComplex()
Definition
cxx14-test-user-defined-literals.cxx:42
testString
bool testString()
Definition
cxx14-test-user-defined-literals.cxx:22
testChrono
bool testChrono()
Definition
cxx14-test-user-defined-literals.cxx:34
main
int main()
Definition
cxx14-test-user-defined-literals.cxx:50
z
GLdouble GLdouble GLdouble z
Definition
glcorearb.h:843
str
const std::string str
Definition
test_ransEncodeDecode.cxx:37
cmake
checks
cxx14-test-user-defined-literals.cxx
Generated on Tue Feb 25 2025 23:16:08 for Project by
1.9.8