|
Fahrzeuge 3: unique pointer
|
#include <iostream>#include <vector>#include <algorithm>#include <memory>#include <numeric>#include <typeinfo>#include "fahrzeug.h"
Go to the source code of this file.
Functions | |
| ostream & | operator<< (ostream &s, const Fahrzeug &p) |
| Prints some info from a vehicle. More... | |
| ostream & | operator<< (ostream &s, const vector< unique_ptr< Fahrzeug >> &v) |
| Prints the whole vector of base class pointers. More... | |
| bool | fuel_consumption (const unique_ptr< Fahrzeug > &a, const unique_ptr< Fahrzeug > &b) |
| Compares the fuel consumption between two vehicles. More... | |
| float | add_fuel (float x, const unique_ptr< Fahrzeug > &y) |
Adds the fuel consumption of a vehicle y to quantity x. More... | |
| int | main () |
| float add_fuel | ( | float | x, |
| const unique_ptr< Fahrzeug > & | y | ||
| ) |
Adds the fuel consumption of a vehicle y to quantity x.
| [in] | x | given quantity |
| [in] | y | base class pointer to vehicle |
Definition at line 65 of file main_try.cpp.

Compares the fuel consumption between two vehicles.
| [in] | a | base class pointer to first vehicle |
| [in] | b | base class pointer to second vehicle |
a needs less fuel than b Definition at line 51 of file main_try.cpp.

| int main | ( | ) |
| ostream& operator<< | ( | ostream & | s, |
| const Fahrzeug & | p | ||
| ) |
Prints some info from a vehicle.
| [in,out] | s | output stream |
| [in] | p | a general vehicle |
Definition at line 141 of file main_try.cpp.

| ostream& operator<< | ( | ostream & | s, |
| const vector< unique_ptr< Fahrzeug >> & | v | ||
| ) |
Prints the whole vector of base class pointers.
| [in,out] | s | output stream |
| [in] | v | vector of base class pointers |
Definition at line 153 of file main_try.cpp.