Remove some uses of std::shared_ptr

This commit is contained in:
Martin Hořeňovský 2020-05-19 15:40:32 +02:00
parent 4394d3ae65
commit c2852c9944
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
4 changed files with 8 additions and 9 deletions

View File

@ -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>();

View File

@ -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;

View File

@ -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;

View File

@ -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