diff options
| author | offa | 2020-01-21 21:04:42 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-02-16 15:25:23 +0100 |
| commit | 06c32862b3d7d20544ba876e590e799667b3afa8 (patch) | |
| tree | 3f15b5a7abc220c562c353f128c989ba312f782f /examples | |
| parent | ab520f4e97ad5e9b01c0f08cda868d9690d35aff (diff) | |
| download | catch3-06c32862b3d7d20544ba876e590e799667b3afa8.tar.gz | |
Some refactorings:
- Overrides added
- usages of push_back() replaced with emplace_back()
- Loop variable made const-refernce
- NULL replaced with nullptr
- Names used in the declaration and definition unified
- size() replaced with empty
- Identical cases merged
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/210-Evt-EventListeners.cpp | 4 | ||||
| -rw-r--r-- | examples/231-Cfg-OutputStreams.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/210-Evt-EventListeners.cpp b/examples/210-Evt-EventListeners.cpp index 4b9d6519..0e03902e 100644 --- a/examples/210-Evt-EventListeners.cpp +++ b/examples/210-Evt-EventListeners.cpp @@ -30,7 +30,7 @@ std::ostream& operator<<(std::ostream& out, Catch::Tag t) { template< typename T > std::ostream& operator<<( std::ostream& os, std::vector<T> const& v ) { os << "{ "; - for ( auto x : v ) + for ( const auto& x : v ) os << x << ", "; return os << "}"; } @@ -63,7 +63,7 @@ void print( std::ostream& os, int const level, Catch::MessageInfo const& info ) void print( std::ostream& os, int const level, std::string const& title, std::vector<Catch::MessageInfo> const& v ) { os << ws(level ) << title << ":\n"; - for ( auto x : v ) + for ( const auto& x : v ) { os << ws(level+1) << "{\n"; print( os, level+2, x ); diff --git a/examples/231-Cfg-OutputStreams.cpp b/examples/231-Cfg-OutputStreams.cpp index 2e92ec80..6c97d1be 100644 --- a/examples/231-Cfg-OutputStreams.cpp +++ b/examples/231-Cfg-OutputStreams.cpp @@ -18,7 +18,7 @@ class out_buff : public std::stringbuf { public: out_buff(std::FILE* stream):m_stream(stream) {} ~out_buff(); - int sync() { + int sync() override { int ret = 0; for (unsigned char c : str()) { if (putc(c, m_stream) == EOF) { |