Skip to content

Commit

Permalink
Revert part of #676 because there is no implicit conversion to std::s…
Browse files Browse the repository at this point in the history
…tring (#680)

when trying to put a parameter that can be converted to std::string, therefore
it will fail with the static_assert when compiling.

Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
  • Loading branch information
jmcarcell and jmcarcell authored Sep 18, 2024
1 parent 4615421 commit 1af6557
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/podio/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,8 @@ class Frame {
/// is supported by GenericParameters
/// @param key The name under which this parameter should be stored
/// @param value The value of the parameter. A copy will be put into the Frame
template <typename T>
template <typename T, typename = podio::EnableIfValidGenericDataType<T>>
inline void putParameter(const std::string& key, T value) {
static_assert(podio::isSupportedGenericDataType<T>, "Unsupported parameter type");
m_self->parameters().set(key, std::move(value));
}

Expand All @@ -247,8 +246,8 @@ class Frame {
///
/// @param key The name under which this parameter should be stored
/// @param value The value of the parameter. A copy will be put into the Frame
inline void putParameter(const std::string& key, const char* value) {
putParameter<std::string>(key, value);
inline void putParameter(const std::string& key, std::string value) {
putParameter<std::string>(key, std::move(value));
}

/// Add a vector of strings value the parameters of the Frame.
Expand Down

0 comments on commit 1af6557

Please sign in to comment.