Skip to content

Commit

Permalink
Addressed review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 committed Feb 16, 2022
1 parent dfc53b9 commit 2b904b8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/platform/ESP32/ESP32Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ struct ESP32Config::Key
const char * Name;

bool operator==(const Key & other) const;

template<typename T, typename std::enable_if_t<std::is_convertible<T, const char *>::value, int> = 0>
Key(const char * aNamespace, T aName) :
Namespace(aNamespace), Name(aName)
{}

template<size_t N>
Key(const char * aNamespace, const char (& aName)[N]) :
Namespace(aNamespace), Name(aName)
{
// Note: N includes null-terminator.
static_assert(N <= ESP32Config::kMaxConfigKeyNameLength + 1,
"Key too long");
}
};

inline bool ESP32Config::Key::operator==(const Key & other) const
Expand Down

0 comments on commit 2b904b8

Please sign in to comment.