Skip to content

Commit

Permalink
DPL: move StringLiteral to FunctionalHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Feb 26, 2024
1 parent 2d17052 commit 23c82aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Framework/Core/include/Framework/AlgorithmSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ struct AlgorithmSpec {
struct AlgorithmPlugin {
virtual AlgorithmSpec create() = 0;
};

template <size_t N>
struct StringLiteral {
constexpr StringLiteral(const char (&str)[N])
{
std::copy_n(str, N, value);
}

char value[N];
};

// Allow fetching inputs from the context using a string literal.
template <StringLiteral lit, typename T>
struct Input {
Expand Down
10 changes: 10 additions & 0 deletions Framework/Foundation/include/Framework/FunctionalHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ struct memfun_type {
};
} // namespace

template <size_t N>
struct StringLiteral {
constexpr StringLiteral(const char (&str)[N])
{
std::copy_n(str, N, value);
}

char value[N];
};

/// Type helper to hold metadata about a lambda or a class
/// method.
template <typename Ret, typename Class, typename... Args>
Expand Down

0 comments on commit 23c82aa

Please sign in to comment.