diff options
| author | Martin Hořeňovský | 2020-05-19 15:40:32 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-05-20 20:25:40 +0200 |
| commit | c2852c9944e0db2fbd51546dc5a945f1e75ef23f (patch) | |
| tree | 8501003ad19a72fb8b973abb199b603698df9174 /src | |
| parent | 4394d3ae65e076c749dc95a27f3178b94ba09e94 (diff) | |
| download | catch3-c2852c9944e0db2fbd51546dc5a945f1e75ef23f.tar.gz | |
Remove some uses of std::shared_ptr
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/benchmark/catch_benchmark.hpp | 2 | ||||
| -rw-r--r-- | src/catch2/internal/catch_console_colour.cpp | 9 | ||||
| -rw-r--r-- | src/catch2/internal/catch_context.cpp | 4 | ||||
| -rw-r--r-- | src/catch2/internal/catch_context.hpp | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/src/catch2/benchmark/catch_benchmark.hpp b/src/catch2/benchmark/catch_benchmark.hpp index 871ab4dd..cca4bcf0 100644 --- a/src/catch2/benchmark/catch_benchmark.hpp +++ b/src/catch2/benchmark/catch_benchmark.hpp @@ -51,7 +51,7 @@ namespace Catch { template <typename Clock = default_clock> void run() { - IConfigPtr cfg = getCurrentContext().getConfig(); + auto const* cfg = getCurrentContext().getConfig(); auto env = Detail::measure_environment<Clock>(); diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp index ee75e2ec..6516018b 100644 --- a/src/catch2/internal/catch_console_colour.cpp +++ b/src/catch2/internal/catch_console_colour.cpp @@ -105,10 +105,9 @@ namespace { IColourImpl* platformColourInstance() { static Win32ColourImpl s_instance; - IConfigPtr config = getCurrentContext().getConfig(); - UseColour::YesOrNo colourMode = config - ? config->useColour() - : UseColour::Auto; + auto const* config = getCurrentContext().getConfig(); + UseColour::YesOrNo colourMode = config? + config->useColour() : UseColour::Auto; if( colourMode == UseColour::Auto ) colourMode = UseColour::Yes; return colourMode == UseColour::Yes @@ -179,7 +178,7 @@ namespace { } IColourImpl* platformColourInstance() { ErrnoGuard guard; - IConfigPtr config = getCurrentContext().getConfig(); + auto const* config = getCurrentContext().getConfig(); UseColour::YesOrNo colourMode = config ? config->useColour() : UseColour::Auto; diff --git a/src/catch2/internal/catch_context.cpp b/src/catch2/internal/catch_context.cpp index d39d5e43..101db6aa 100644 --- a/src/catch2/internal/catch_context.cpp +++ b/src/catch2/internal/catch_context.cpp @@ -21,8 +21,8 @@ namespace Catch { return m_runner; } - IConfigPtr const& getConfig() const override { - return m_config; + IConfig const* getConfig() const override { + return m_config.get(); } ~Context() override; diff --git a/src/catch2/internal/catch_context.hpp b/src/catch2/internal/catch_context.hpp index c579c399..4fb5461b 100644 --- a/src/catch2/internal/catch_context.hpp +++ b/src/catch2/internal/catch_context.hpp @@ -25,7 +25,7 @@ namespace Catch { virtual IResultCapture* getResultCapture() = 0; virtual IRunner* getRunner() = 0; - virtual IConfigPtr const& getConfig() const = 0; + virtual IConfig const* getConfig() const = 0; }; struct IMutableContext : IContext |