Skip to content

Commit

Permalink
Add assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxwa committed Oct 11, 2024
1 parent 7f35556 commit 9d7a536
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#ifndef _MSFT_PROXY_
#define _MSFT_PROXY_

#include <cassert>
#include <cstddef>
#include <bit>
#include <concepts>
Expand Down Expand Up @@ -565,12 +566,14 @@ struct meta_ptr_reset_guard {

template <class F>
struct proxy_helper {
static inline const auto& get_meta(const proxy<F>& p) noexcept
{ return *p.meta_.operator->(); }
static inline const auto& get_meta(const proxy<F>& p) noexcept {
assert(p.has_value());
return *p.meta_.operator->();
}
template <class C, class O, qualifier_type Q, class... Args>
static decltype(auto) invoke(add_qualifier_t<proxy<F>, Q> p, Args&&... args) {
auto dispatcher = p.meta_
->template dispatcher_meta<typename overload_traits<O>
auto dispatcher = get_meta(p)
.template dispatcher_meta<typename overload_traits<O>
::template meta_provider<C::is_direct, typename C::dispatch_type>>
::dispatcher;
if constexpr (C::is_direct &&
Expand Down

0 comments on commit 9d7a536

Please sign in to comment.