Fabric: Proper includes in ContextContainer

Summary: Trivial. Suddenly, compiler is unhappy without all proper headers.

Reviewed By: mdvacca

Differential Revision: D9884891

fbshipit-source-id: 7a5b175923f06bdb87bff8c9aad9f4ee40febbe9
This commit is contained in:
Valentin Shergin 2018-09-24 12:54:24 -07:00 committed by Facebook Github Bot
parent 0a2825f8b3
commit 60a4faa578
1 changed files with 4 additions and 2 deletions

View File

@ -7,9 +7,11 @@
#include <memory>
#include <mutex>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <utility>
namespace facebook {
namespace react {
@ -31,7 +33,7 @@ public:
* by `{type, key}` pair.
*/
template<typename T>
void registerInstance(const T &instance, const std::string &key = "") {
void registerInstance(const T &instance, const std::string &key = {}) {
std::lock_guard<std::mutex> lock(mutex_);
instances_.insert({
@ -46,7 +48,7 @@ public:
* by {type, key} pair.
*/
template<typename T>
T getInstance(const std::string &key = "") const {
T getInstance(const std::string &key = {}) const {
std::lock_guard<std::mutex> lock(mutex_);
return *std::static_pointer_cast<T>(instances_.at({std::type_index(typeid(T)), key}));