#include "fahrzeug.h"
#include <algorithm>
#include <iostream>
#include <memory>
#include <numeric>
#include <typeinfo>
#include <vector>
Go to the source code of this file.
◆ add_fuel()
| float add_fuel |
( |
float |
x, |
|
|
const shared_ptr< Fahrzeug > & |
y |
|
) |
| |
Adds the fuel consumption of a vehicle y to quantity x.
- Parameters
-
| [in] | x | given quantity |
| [in] | y | base class pointer to vehicle |
- Returns
- x+y.fuel
Definition at line 65 of file main.cpp.
◆ fuel_consumption()
| bool fuel_consumption |
( |
const shared_ptr< Fahrzeug > & |
a, |
|
|
const shared_ptr< Fahrzeug > & |
b |
|
) |
| |
Compares the fuel consumption between two vehicles.
- Parameters
-
| [in] | a | base class pointer to first vehicle |
| [in] | b | base class pointer to second vehicle |
- Returns
- true if
a needs less fuel than b
Definition at line 51 of file main.cpp.
◆ main()
◆ operator<<() [1/2]
| ostream & operator<< |
( |
ostream & |
s, |
|
|
const Fahrzeug & |
p |
|
) |
| |
Prints some info from a vehicle.
- Parameters
-
| [in,out] | s | output stream |
| [in] | p | a general vehicle |
- Returns
- changed output stream
Definition at line 138 of file main.cpp.
◆ operator<<() [2/2]
| ostream & operator<< |
( |
ostream & |
s, |
|
|
const vector< shared_ptr< Fahrzeug >> & |
v |
|
) |
| |
Prints the whole vector of base class pointers.
- Parameters
-
| [in,out] | s | output stream |
| [in] | v | vector of base class pointers |
- Returns
- changed output stream
Definition at line 150 of file main.cpp.