Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions include/boost/openmethod/detail/static_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ class static_list {

friend auto operator==(const iterator& a, const iterator& b) -> bool {
return a.ptr == b.ptr;
};
}

friend auto operator!=(const iterator& a, const iterator& b) -> bool {
return a.ptr != b.ptr;
};
}

private:
T* ptr;
Expand Down Expand Up @@ -179,11 +180,12 @@ class static_list {
friend auto
operator==(const const_iterator& a, const const_iterator& b) -> bool {
return a.ptr == b.ptr;
};
}

friend auto
operator!=(const const_iterator& a, const const_iterator& b) -> bool {
return a.ptr != b.ptr;
};
}

private:
T* ptr;
Expand Down
24 changes: 13 additions & 11 deletions include/boost/openmethod/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ struct va_args<ReturnType> {
::boost::openmethod::detail::va_args<__VA_ARGS__>::registry>

#define BOOST_OPENMETHOD(NAME, ARGS, ...) \
template<typename...> \
struct BOOST_OPENMETHOD_OVERRIDERS(NAME); \
struct BOOST_OPENMETHOD_ID(NAME); \
template<typename... ForwarderParameters> \
typename ::boost::openmethod::detail::enable_forwarder< \
Expand All @@ -72,14 +70,16 @@ struct va_args<ReturnType> {
ForwarderParameters...>::type \
BOOST_OPENMETHOD_GUIDE(NAME)(ForwarderParameters && ... args); \
template<typename... ForwarderParameters> \
inline auto NAME(ForwarderParameters&&... args) -> \
typename ::boost::openmethod::detail::enable_forwarder< \
inline auto NAME(ForwarderParameters&&... args) \
->typename ::boost::openmethod::detail::enable_forwarder< \
void, BOOST_OPENMETHOD_TYPE(NAME, ARGS, __VA_ARGS__), \
::boost::openmethod::detail::va_args<__VA_ARGS__>::return_type, \
ForwarderParameters...>::type { \
return BOOST_OPENMETHOD_TYPE(NAME, ARGS, __VA_ARGS__)::fn( \
std::forward<ForwarderParameters>(args)...); \
}
} \
template<typename...> \
struct BOOST_OPENMETHOD_OVERRIDERS(NAME)
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semicolon at the end of this struct declaration should not be removed. This is part of a macro definition (BOOST_OPENMETHOD), and the struct declaration needs to end with a semicolon for proper syntax. Users of this macro will not add a semicolon after the macro invocation since the macro previously provided it.

Suggested change
struct BOOST_OPENMETHOD_OVERRIDERS(NAME)
struct BOOST_OPENMETHOD_OVERRIDERS(NAME);

Copilot uses AI. Check for mistakes.

#define BOOST_OPENMETHOD_DETAIL_LOCATE_METHOD(NAME, ARGS) \
template<typename T> \
Expand All @@ -88,7 +88,7 @@ struct va_args<ReturnType> {
struct boost_openmethod_detail_locate_method_aux<void(A...)> { \
using type = \
decltype(BOOST_OPENMETHOD_GUIDE(NAME)(std::declval<A>()...)); \
};
}
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semicolon at the end of this struct definition should not be removed. This is part of a macro definition (BOOST_OPENMETHOD_DETAIL_LOCATE_METHOD), and the struct definition needs to end with a semicolon for proper syntax. Users of this macro will expect the semicolon to be included in the expansion.

Suggested change
}
};

Copilot uses AI. Check for mistakes.

#define BOOST_OPENMETHOD_DECLARE_OVERRIDER(NAME, ARGS, ...) \
template<typename...> \
Expand All @@ -102,13 +102,15 @@ struct va_args<ReturnType> {
static auto next(Args&&... args) -> decltype(auto); \
}; \
inline auto BOOST_OPENMETHOD_OVERRIDERS( \
NAME)<__VA_ARGS__ ARGS>::has_next() -> bool { \
NAME)<__VA_ARGS__ ARGS>::has_next() \
->bool { \
return boost_openmethod_detail_locate_method_aux< \
void ARGS>::type::has_next<fn>(); \
} \
template<typename... Args> \
inline auto BOOST_OPENMETHOD_OVERRIDERS(NAME)<__VA_ARGS__ ARGS>::next( \
Args&&... args) -> decltype(auto) { \
Args&&... args) \
->decltype(auto) { \
return boost_openmethod_detail_locate_method_aux< \
void ARGS>::type::next<fn>(std::forward<Args>(args)...); \
}
Expand All @@ -123,7 +125,7 @@ struct va_args<ReturnType> {
#define BOOST_OPENMETHOD_DEFINE_OVERRIDER(NAME, ARGS, ...) \
BOOST_OPENMETHOD_DETAIL_REGISTER_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
auto BOOST_OPENMETHOD_OVERRIDER(NAME, ARGS, __VA_ARGS__)::fn ARGS \
-> boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>
->boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>

#define BOOST_OPENMETHOD_OVERRIDE(NAME, ARGS, ...) \
BOOST_OPENMETHOD_DECLARE_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
Expand All @@ -133,9 +135,9 @@ struct va_args<ReturnType> {
BOOST_OPENMETHOD_DECLARE_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
BOOST_OPENMETHOD_DETAIL_REGISTER_OVERRIDER(NAME, ARGS, __VA_ARGS__) \
inline auto BOOST_OPENMETHOD_OVERRIDER(NAME, ARGS, __VA_ARGS__)::fn ARGS \
-> boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>
->boost::mp11::mp_back<boost::mp11::mp_list<__VA_ARGS__>>

#define BOOST_OPENMETHOD_CLASSES(...) \
BOOST_OPENMETHOD_REGISTER(::boost::openmethod::use_classes<__VA_ARGS__>);
BOOST_OPENMETHOD_REGISTER(::boost::openmethod::use_classes<__VA_ARGS__>)
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semicolon at the end of this statement should not be removed. This is part of a macro definition (BOOST_OPENMETHOD_CLASSES), and the statement needs to end with a semicolon for proper syntax. Users of this macro will not add a semicolon after the macro invocation since the macro previously provided it.

Suggested change
BOOST_OPENMETHOD_REGISTER(::boost::openmethod::use_classes<__VA_ARGS__>)
BOOST_OPENMETHOD_REGISTER(::boost::openmethod::use_classes<__VA_ARGS__>);

Copilot uses AI. Check for mistakes.

#endif
2 changes: 1 addition & 1 deletion include/boost/openmethod/policies/vptr_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct vptr_vector : vptr {
} else {
detail::vptr_vector_vptrs<Registry>.clear();
}
};
}
};
};

Expand Down
Loading