Use boost::optional and boost::none instead of smelly pointer (#24134)

* Remove bad pointer usage from CharacterCache

Use TrinityCore Option type instead which is intended for this purpose. (Wrapper around boost::option until C++17 bump is finalised)

* Unify codestyle regarding TC optional type

Based upon advice from @Shauren

(cherry picked from commit 76831f1f46)
This commit is contained in:
Ujp8LfXBJ6wCPR
2020-02-08 20:29:18 +01:00
committed by Shauren
parent 94a79bac7a
commit 91a0fbbd71
6 changed files with 8 additions and 11 deletions

View File

@@ -278,7 +278,7 @@ Optional<std::shared_ptr<ScriptModule>>
path.generic_string().c_str());
}
return boost::none;
return {};
}
// Use RAII to release the library on failure.
@@ -305,7 +305,7 @@ Optional<std::shared_ptr<ScriptModule>>
TC_LOG_ERROR("scripts.hotswap", "Could not extract all required functions from the shared library \"%s\"!",
path.generic_string().c_str());
return boost::none;
return {};
}
}