Skip to content

Commit

Permalink
Simplify str_arg_char specialization for ATL/MFC strings (C++20)
Browse files Browse the repository at this point in the history
Remove derived_from_CSimpleString concept and use constraint instead.
  • Loading branch information
rmisev committed Nov 7, 2024
1 parent 6bea3d3 commit f3b9b19
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/upa/url_for_atl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ struct str_arg_char_for_atl {
#ifdef UPA_CPP_20

// CStringT and CFixedStringT are derived from CSimpleStringT
template<class StrT>
concept derived_from_CSimpleString =
template<class StrT> requires
std::derived_from<StrT, ATL::CSimpleStringT<char, true>> ||
std::derived_from<StrT, ATL::CSimpleStringT<wchar_t, true>> ||
std::derived_from<StrT, ATL::CSimpleStringT<char, false>> ||
std::derived_from<StrT, ATL::CSimpleStringT<wchar_t, false>>;

template<derived_from_CSimpleString StrT>
std::derived_from<StrT, ATL::CSimpleStringT<wchar_t, false>>
struct str_arg_char<StrT> : public str_arg_char_for_atl<StrT> {};

#else // UPA_CPP_20
Expand Down

0 comments on commit f3b9b19

Please sign in to comment.