Commit Graph

633 Commits

Author SHA1 Message Date
ToruNiina
4b1df61142 Merge branch 'master' into recursive-find-or 2021-05-15 20:01:30 +09:00
ToruNiina
0ac3919e08 feat: from<T> and from_toml precede constructor
constructor sometimes has `template<T> ctor(const T&)` and it causes
ambiguity. To avoid it, from<T> and T.from_toml precedes any
constructor. But, to check the ambiguity between from<T> and from_toml,
they do not precede each other. If anyone define both from<T> and
from_toml, it causes compilation error.
2021-05-14 16:05:54 +09:00
ToruNiina
e622595426 fix: fix has_specialized_from/into
to avoid ambiguity
2021-05-14 16:01:43 +09:00
ToruNiina
72ee8caf09 refactor: use has_specialized_from<T>
to check if toml::from<T> exists for a specific T
2021-05-14 15:53:34 +09:00
ToruNiina
b6e2c6e235 feat: add detail::has_specialization_from/into 2021-05-14 15:46:00 +09:00
ToruNiina
7e90282175 fix: add region where -Wshadow is ignored on GCC 4 2021-05-10 23:00:30 +09:00
ToruNiina
b8291af42b fix: rename func args to avoid -Wshadow in GCC 4.x 2021-05-10 22:56:16 +09:00
ToruNiina
cd60045014 fix: gcc 7 introduces wshadow variants 2021-05-10 21:51:51 +09:00
ToruNiina
4acc563b28 feat: explicitly avoid -Wshadow=global in GCC 2021-05-10 20:49:20 +09:00
ToruNiina
dce50142e6 fix: avoid argname key to supress warning
about shadowing
2021-05-10 20:47:08 +09:00
ToruNiina
c40e0dbd37 feat: use comment macro everywhere 2021-04-16 15:29:24 +09:00
ToruNiina
d90c26f9ac feat: add TOML11_PRESERVE_COMMENTS_BY_DEFAULT 2021-04-16 15:28:58 +09:00
ToruNiina
b592ddcca2 fix: add SFINAE to avoid incorrect matching 2021-04-14 13:09:51 +09:00
ToruNiina
5518b2b155 refactor: simplify last_one_in_pack meta func 2021-04-14 13:09:25 +09:00
ToruNiina
ba3d41d913 feat(#156): add find_or(value, keys..., opt) 2021-04-14 11:22:19 +09:00
ToruNiina
db1f42b5da fix: enable to control macro definition 2021-04-02 17:21:25 +09:00
ToruNiina
14c6430dda Merge branch 'master' into auto-conversion-macro 2021-04-02 16:25:41 +09:00
ToruNiina
a3b8dd6787 fix(#152): add newline btw kv-pair and subtables 2021-03-31 10:52:18 +09:00
ToruNiina
c121492071 fix: uneven spacing between tables
related: issue #152
2021-03-29 17:48:03 +09:00
ToruNiina
b924e70e3c feat: add a simple way to disable <filesystem>
As jwillikers pointed out in #150, there is a case where compiler
defines the corresponding feature test macro of <filesystem> but is
actually not available. The macro is a way to disable the feature
regardless of the status of feature test macro.
2021-03-25 11:44:11 +09:00
sneakypete81
08859c36d0
Fix typo in error message 2021-01-30 20:04:00 +00:00
Alex Merry
db2d33ca4b Add missing header for std::out_of_range exception
Failure seen on GCC 4.8.5 when including "toml/value.hpp".
2020-12-09 10:39:10 +00:00
Alex Merry
935da51769 Add missing include for ostringstream
Since region.hpp no longer includes <iostream> (but only <iomanip>),
source_location.hpp no longer includes a header that provides
std::ostringstream. Including <sstream> fixes this.
2020-12-09 10:19:07 +00:00
ToruNiina
9b472a6c72 fix: check it is empty before calling back 2020-11-04 23:24:59 +09:00
ToruNiina
1ead14589e fix: check if it is empty before calling back() 2020-11-04 23:24:02 +09:00
ToruNiina
a6581ee66b fix: an empty array is not an array of table 2020-11-03 20:34:01 +09:00
ToruNiina
908b91079b fix: distinguish the comments and try to keep it
If a value has a comment, we need to try to write it explicitly.
2020-10-18 20:43:33 +09:00
ToruNiina
fce6ff317e refactor: distinguish the reason of failure 2020-10-18 18:36:05 +09:00
ToruNiina
fd50b11523 refactor: add write_comments() 2020-10-18 18:35:56 +09:00
ToruNiina
9090b8273c refactor: move array-of-table stuff to a function 2020-10-18 17:20:06 +09:00
ToruNiina
88882b523f feat: add a macro defines convertion automatically 2020-10-16 21:40:47 +09:00
ToruNiina
382e3dc3ab refactor: use serializer::is_array_of_tables 2020-10-14 22:27:29 +09:00
ToruNiina
f7bfcdd7aa fix: check all the elements in an array
while checking if the array is array-of-tables or not (heterogeneous
arrays are allowed, so there might be an array that has a table and
an integer at the same time)
2020-10-14 18:00:04 +09:00
ToruNiina
2e41a26785 Merge branch 'master' of github.com:ToruNiina/toml11 into master 2020-10-14 15:35:18 +09:00
ToruNiina
f283a257d2 Revert "quick temporary patch for comment dup"
This reverts commit a6d38c1ec0.
Since the problem is solved, we don't need this patch any more.
2020-10-13 22:02:32 +09:00
ToruNiina
3d86f3a4e1 fix: avoid comment duplication in array of tables 2020-10-13 21:59:46 +09:00
ToruNiina
dc5a8069a9 refactor: require comments while construction
Note: at this commit, the code would not compile.
2020-10-13 21:58:08 +09:00
Ivan Shynkarenka
5d8c573357 Fixed: Compile toml11 with MinGW cause error in <filesystem> #136 2020-10-03 23:16:58 +03:00
Ivan Shynkarenka
6e1e5ccd84 Fixed: Compile toml11 with MinGW cause error in <filesystem> #136 2020-10-03 23:06:47 +03:00
Ivan Shynkarenka
f2d9fd1d1f Fixed: Compile toml11 with MinGW cause error in <filesystem> #136 2020-10-03 22:36:59 +03:00
Ivan Shynkarenka
97c8cbdaf5 Fixed: Compile toml11 with MinGW cause error in <filesystem> #135 2020-10-02 19:10:04 +03:00
ToruNiina
05ceb5ae79 fix: workaround for error around SFINAE in MSVC
avoid lambda with template argument
2020-09-29 02:26:16 +09:00
ToruNiina
0fec125688 feat: remove default value from internal src 2020-09-29 01:40:49 +09:00
ToruNiina
a6d38c1ec0 fix: add a quick temporary patch for comment dup
first aid for #131
2020-09-22 17:36:24 +09:00
ToruNiina
670186fac7 Merge branch 'master' into allow-comment-before-comma 2020-09-19 18:10:45 +09:00
ToruNiina
a32cd6cb61 feat: enable to use u8""_toml literal in C++20 2020-09-16 21:24:03 +09:00
ToruNiina
003bc16c1b fix: skip the last zero in the file 2020-09-14 16:35:51 +09:00
ToruNiina
5f38127692 feat: allow comments before comma
replace ws by ws_comment_newline, as suggested.
discussed here: toml-lang/toml/issues/766
2020-08-16 11:03:58 +09:00
ToruNiina
3c3ebd88b4 feat: improve error message about invalid keys 2020-08-09 18:38:50 +09:00
ToruNiina
08f7ea9c56 refactor: remove extraneous whitespaces in errmsg 2020-08-09 18:38:21 +09:00