Skip to content

Commit

Permalink
[DL] add function_wrapper_t deduction guide
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Jan 31, 2024
1 parent 67fb6c3 commit 52cb9bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/interop/dl-api/include/alpaqa/dl/dl-problem.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,14 @@ using problem_functions_t = alpaqa_problem_functions_t;
using control_problem_functions_t = alpaqa_control_problem_functions_t;

namespace detail {
/// Custom type for which we can export the RTTI to support std::any across
/// shared library boundaries when using libc++.
template <class Signature>
struct ALPAQA_DL_PROBLEM_EXPORT function_wrapper_t {
std::function<Signature> function;
};
template <class Signature>
function_wrapper_t(std::function<Signature>) -> function_wrapper_t<Signature>;
} // namespace detail

/// Make the given function available to alpaqa.
Expand Down

0 comments on commit 52cb9bd

Please sign in to comment.