Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_cpp.cxx
Go to the documentation of this file.
1
// test various C++ constructs, particularly wacky new ones.
2
3
#include <string>
4
#include <iostream>
5
#include <vector>
6
7
struct
Person {
8
std::string
name
;
9
int
id
;
10
};
11
12
void
fill_people
(std::vector<Person>& people)
13
{
14
Person guy{
"Joe"
, 1}, gal{
"Jane"
, 2};
// fancy initializing
15
people.push_back(
std::move
(guy));
16
people.push_back(
std::move
(gal));
17
}
18
19
int
main
()
20
{
21
std::vector<Person> people;
22
fill_people
(people);
23
24
for
(
auto
peep : people) {
25
std::cout <<
" #"
<< peep.id <<
": "
<< peep.name <<
std::endl
;
26
}
27
}
string
std::string string
Definition:
nybbler.cc:12
wirecell.gen.depos.move
def move(depos, offset)
Definition:
depos.py:107
main
int main()
Definition:
test_cpp.cxx:19
Person::id
int id
Definition:
test_cpp.cxx:9
Person::name
std::string name
Definition:
test_cpp.cxx:8
fill_people
void fill_people(std::vector< Person > &people)
Definition:
test_cpp.cxx:12
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11