Skip to content

Commit 8e0b204

Browse files
authored
Merge pull request #226 from tetengo/cpp20
Cpp20
2 parents 4003b50 + 5e57386 commit 8e0b204

File tree

83 files changed

+656
-351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+656
-351
lines changed

configure.ac

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ AC_CONFIG_FILES([
103103
])
104104

105105
AC_LANG([C++])
106-
AX_CXX_COMPILE_STDCXX_17([noext], [mandatory])
106+
#AX_CXX_COMPILE_STDCXX(17, [noext], [mandatory]) # C++20 is not supported yet.
107107

108108
#### Program Checks ####
109109
AC_PROG_CXX
@@ -122,8 +122,8 @@ AC_ARG_WITH(
122122
AC_CHECK_PROG(IWYU, include-what-you-use, include-what-you-use)
123123
test -z $IWYU && \
124124
AC_MSG_WARN([You cannot check the includes for lack of include-what-you-use.])
125-
AC_SUBST([IWYU_OPTS_CXX], "-Xiwyu --max_line_length=200 -x c++ -std=c++17 -DIWYU")
126-
AC_SUBST([IWYU_OPTS_C], "-Xiwyu --max_line_length=200 -x c -std=c17 -DIWYU")
125+
AC_SUBST([IWYU_OPTS_CXX], "-Xiwyu --max_line_length=200 -x c++ -DIWYU")
126+
AC_SUBST([IWYU_OPTS_C], "-Xiwyu --max_line_length=200 -x c -DIWYU")
127127
AC_SUBST([IWYU_IMP_PATH], "kogyan/tool/iwyu_mappings.imp")
128128

129129
AC_ARG_WITH(
@@ -198,7 +198,8 @@ AC_HEADER_STDC
198198
AC_SUBST([CPPFLAGS], "${CPPFLAGS} ${BOOST_CPPFLAGS}")
199199

200200
#### Compilation Options ####
201-
AC_SUBST([CXXFLAGS], "${CXXFLAGS} -Werror -Wall -Wextra -pedantic-errors")
201+
AC_SUBST([CXXFLAGS_IWYU], "${CXXFLAGS} -std=c++2a -Werror -Wall -Wextra -pedantic-errors")
202+
AC_SUBST([CXXFLAGS], "${CXXFLAGS} -std=c++20 -Werror -Wall -Wextra -pedantic-errors")
202203
AC_SUBST([CFLAGS], "${CFLAGS} -std=c17 -Werror -Wall -Wextra -pedantic-errors")
203204

204205
#### Output ####

executable/setup/src/winmain.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include <Windows.h>
1515

16-
#include <boost/algorithm/string.hpp>
17-
1816
#include <tetengo/text/encoder.hpp>
1917
#include <tetengo/text/encoding/utf16.hpp>
2018

@@ -61,7 +59,7 @@ namespace
6159
{
6260
const auto msi_path = base_directory / msi_file_name;
6361
auto parameters = std::wstring{ L"/i \"" } + msi_path.native() + std::wstring{ L"\"" };
64-
if (boost::algorithm::starts_with(locale_name, "Japanese"))
62+
if (locale_name.starts_with("Japanese"))
6563
{
6664
parameters += L" TRANSFORMS=\":ja.mst\"";
6765
}

kogyan

library/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Copyright (C) 2019-2022 kaoru https://www.tetengo.org/
33

44
SUBDIRS = \
5-
json \
6-
lattice \
75
platform_dependent \
86
text \
7+
json \
8+
lattice \
99
property \
1010
trie
1111

library/json/c/src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IWYU_OPTS_CXX += -Xiwyu --mapping_file=${top_srcdir}/${IWYU_IMP_PATH}
3030
iwyu: ${addsuffix .iwyuout, ${headers} ${sources}}
3131

3232
%.iwyuout: %
33-
${IWYU} ${IWYU_OPTS_CXX} ${CPPFLAGS} ${libtetengo_json_la_CPPFLAGS} ${CXXFLAGS} $< 2> ${addsuffix .tmp, $@} || true
33+
${IWYU} ${IWYU_OPTS_CXX} ${CPPFLAGS} ${libtetengo_json_la_CPPFLAGS} ${CXXFLAGS_IWYU} $< 2> ${addsuffix .tmp, $@} || true
3434
mv -f ${addsuffix .tmp, $@} $@
3535

3636
.PHONY: clean-iwyu

library/json/c/src/tetengo_json_element.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct tetengo_json_element_tag
2626

2727
explicit tetengo_json_element_tag(std::unique_ptr<tetengo::json::element>&& p_cpp_element) :
2828
p_cpp_element_holder{ std::move(p_cpp_element) },
29-
p_cpp_element{ p_cpp_element_holder.get() },
29+
p_cpp_element{ std::to_address(p_cpp_element_holder) },
3030
type{},
3131
file_location{}
3232
{}

library/json/c/src/tetengo_json_jsonParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const tetengo_json_element_t* tetengo_json_jsonParser_peek(const tetengo_json_js
112112
}
113113

114114
p_parser->p_current_element = std::make_unique<tetengo_json_element_t>(&p_parser->p_cpp_parser->peek());
115-
return p_parser->p_current_element.get();
115+
return std::to_address(p_parser->p_current_element);
116116
}
117117
catch (...)
118118
{

library/json/c/src/tetengo_json_reader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const tetengo_json_reader_t* tetengo_json_reader_baseReader(const tetengo_json_r
227227

228228
p_reader->p_base_reader_placeholder =
229229
std::make_unique<tetengo_json_reader_t>(&p_reader->cpp_reader().base_reader());
230-
return p_reader->p_base_reader_placeholder.get();
230+
return std::to_address(p_reader->p_base_reader_placeholder);
231231
}
232232
catch (...)
233233
{

library/json/cpp/include/tetengo/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ iwyu: ${addsuffix .iwyuout, ${pkg_headers} ${extra_headers}}
2929

3030
%.iwyuout: %
3131
mkdir -p ${dir $@}
32-
${IWYU} ${IWYU_OPTS_CXX} ${CPPFLAGS} ${iwyu_CPPFLAGS} ${CXXFLAGS} $< 2> ${addsuffix .tmp, $@} || true
32+
${IWYU} ${IWYU_OPTS_CXX} ${CPPFLAGS} ${iwyu_CPPFLAGS} ${CXXFLAGS_IWYU} $< 2> ${addsuffix .tmp, $@} || true
3333
mv -f ${addsuffix .tmp, $@} $@
3434

3535
.PHONY: clean-iwyu

library/json/cpp/include/tetengo/json/reader_iterator.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ namespace tetengo::json
7676
*/
7777
reader_iterator& operator++();
7878

79-
//! Makes operator++(int) visible.
80-
using boost::stl_interfaces::iterator_interface<reader_iterator, std::input_iterator_tag, char, char>::
81-
operator++;
79+
/*!
80+
\brief Postincrements the iterator.
81+
82+
\return The iterator before the incrementation.
83+
*/
84+
reader_iterator operator++(int);
8285

8386

8487
private:

0 commit comments

Comments
 (0)