mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Remove some uses of std::shared_ptr
This commit is contained in:
parent
4394d3ae65
commit
c2852c9944
@ -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>();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user