Skip to content

Commit

Permalink
Fix the VS2022 build.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzlaine committed Dec 17, 2023
1 parent 1bbad0a commit 9c0e078
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
8 changes: 3 additions & 5 deletions include/boost/parser/detail/text/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@
#endif


// The contents of <ranges> in libstdc++ is incomplete (e.g. no owning_view)
// before GCC 12.
#if !BOOST_PARSER_USE_CONCEPTS
#if !BOOST_PARSER_USE_CONCEPTS || defined(_MSC_VER)
# define BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS 0
#else
# define BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS 1
#endif

// GCC 12 claims to support 201907L <= __cpp_deduction_guides, but does not.
#if defined(__cpp_deduction_guides) && 201907L <= __cpp_deduction_guides && \
(!defined(__GNUC__) || 13 <= __GNUC__)
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS && defined(__cpp_deduction_guides) && \
201907L <= __cpp_deduction_guides && (!defined(__GNUC__) || 13 <= __GNUC__)
#define BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD 1
#else
#define BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD 0
Expand Down
2 changes: 1 addition & 1 deletion include/boost/parser/detail/text/transcode_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ namespace boost::parser::detail { namespace text {
#else
template<typename F>
#endif
constexpr detail::project_impl<F> project;
constexpr detail::project_impl<F> project{};

#if BOOST_PARSER_DETAIL_TEXT_USE_ALIAS_CTAD

Expand Down
14 changes: 7 additions & 7 deletions include/boost/parser/transcode_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace boost::parser {

#else

#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
template<detail::text::utf_range V>
requires std::ranges::view<V>
#else
Expand All @@ -47,15 +47,15 @@ namespace boost::parser {
{
public:
constexpr utf8_view()
#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
requires std::default_initializable<V>
#endif
= default;
constexpr utf8_view(V base) :
detail::text::utf_view<format::utf8, V>{std::move(base)}
{}
};
#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
template<detail::text::utf_range V>
requires std::ranges::view<V>
#else
Expand All @@ -65,15 +65,15 @@ namespace boost::parser {
{
public:
constexpr utf16_view()
#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
requires std::default_initializable<V>
#endif
= default;
constexpr utf16_view(V base) :
detail::text::utf_view<format::utf16, V>{std::move(base)}
{}
};
#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
template<detail::text::utf_range V>
requires std::ranges::view<V>
#else
Expand All @@ -83,7 +83,7 @@ namespace boost::parser {
{
public:
constexpr utf32_view()
#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
requires std::default_initializable<V>
#endif
= default;
Expand All @@ -92,7 +92,7 @@ namespace boost::parser {
{}
};

#if BOOST_PARSER_USE_CONCEPTS
#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
template<class R>
utf8_view(R &&) -> utf8_view<std::views::all_t<R>>;
template<class R>
Expand Down

0 comments on commit 9c0e078

Please sign in to comment.