NeBuild dev
Loading...
Searching...
No Matches
table.hpp
Go to the documentation of this file.
1//# This file is a part of toml++ and is subject to the the terms of the MIT license.
2//# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
3//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
4// SPDX-License-Identifier: MIT
5#pragma once
6
8#include "std_map.hpp"
10#include "array.hpp"
11#include "make_node.hpp"
12#include "node_view.hpp"
13#include "key.hpp"
14#include "header_start.hpp"
15
18{
19 template <bool IsConst>
20 struct table_proxy_pair
21 {
22 using value_type = std::conditional_t<IsConst, const node, node>;
23
24 const toml::key& first;
25 value_type& second;
26 };
27
28 template <bool IsConst>
29 class table_iterator
30 {
31 private:
32 template <bool>
33 friend class table_iterator;
34
35 using proxy_type = table_proxy_pair<IsConst>;
36 using mutable_map_iterator = std::map<toml::key, node_ptr, std::less<>>::iterator;
37 using const_map_iterator = std::map<toml::key, node_ptr, std::less<>>::const_iterator;
38 using map_iterator = std::conditional_t<IsConst, const_map_iterator, mutable_map_iterator>;
39
40 mutable map_iterator iter_;
41 alignas(proxy_type) mutable unsigned char proxy_[sizeof(proxy_type)];
42 mutable bool proxy_instantiated_ = false;
43
45 proxy_type* get_proxy() const noexcept
46 {
47 if (!proxy_instantiated_)
48 {
49 auto p = ::new (static_cast<void*>(proxy_)) proxy_type{ iter_->first, *iter_->second.get() };
50 proxy_instantiated_ = true;
51 return p;
52 }
53 else
54 return TOML_LAUNDER(reinterpret_cast<proxy_type*>(proxy_));
55 }
56
57 public:
59 table_iterator() noexcept = default;
60
62 explicit table_iterator(mutable_map_iterator iter) noexcept //
63 : iter_{ iter }
64 {}
65
66 TOML_CONSTRAINED_TEMPLATE(C, bool C = IsConst)
68 explicit table_iterator(const_map_iterator iter) noexcept //
69 : iter_{ iter }
70 {}
71
72 TOML_CONSTRAINED_TEMPLATE(C, bool C = IsConst)
74 table_iterator(const table_iterator<false>& other) noexcept //
75 : iter_{ other.iter_ }
76 {}
77
79 table_iterator(const table_iterator& other) noexcept //
80 : iter_{ other.iter_ }
81 {}
82
83 table_iterator& operator=(const table_iterator& rhs) noexcept
84 {
85 iter_ = rhs.iter_;
86 proxy_instantiated_ = false;
87 return *this;
88 }
89
90 using value_type = table_proxy_pair<IsConst>;
91 using reference = value_type&;
92 using pointer = value_type*;
93 using difference_type = typename std::iterator_traits<map_iterator>::difference_type;
94 using iterator_category = typename std::iterator_traits<map_iterator>::iterator_category;
95
96 table_iterator& operator++() noexcept // ++pre
97 {
98 ++iter_;
99 proxy_instantiated_ = false;
100 return *this;
101 }
102
103 table_iterator operator++(int) noexcept // post++
104 {
105 table_iterator out{ iter_ };
106 ++iter_;
107 proxy_instantiated_ = false;
108 return out;
109 }
110
111 table_iterator& operator--() noexcept // --pre
112 {
113 --iter_;
114 proxy_instantiated_ = false;
115 return *this;
116 }
117
118 table_iterator operator--(int) noexcept // post--
119 {
120 table_iterator out{ iter_ };
121 --iter_;
122 proxy_instantiated_ = false;
123 return out;
124 }
125
127 reference operator*() const noexcept
128 {
129 return *get_proxy();
130 }
131
133 pointer operator->() const noexcept
134 {
135 return get_proxy();
136 }
137
139 explicit operator const map_iterator&() const noexcept
140 {
141 return iter_;
142 }
143
144 TOML_CONSTRAINED_TEMPLATE(!C, bool C = IsConst)
146 explicit operator const const_map_iterator() const noexcept
147 {
148 return iter_;
149 }
150
152 friend bool operator==(const table_iterator& lhs, const table_iterator& rhs) noexcept
153 {
154 return lhs.iter_ == rhs.iter_;
155 }
156
158 friend bool operator!=(const table_iterator& lhs, const table_iterator& rhs) noexcept
159 {
160 return lhs.iter_ != rhs.iter_;
161 }
162 };
163
164 struct table_init_pair
165 {
166 mutable toml::key key;
167 mutable node_ptr value;
168
169 template <typename K, typename V>
171 table_init_pair(K&& k, V&& v, value_flags flags = preserve_source_value_flags) //
172 : key{ static_cast<K&&>(k) },
173 value{ make_node(static_cast<V&&>(v), flags) }
174 {}
175 };
176}
179
181{
183 using table_iterator = POXY_IMPLEMENTATION_DETAIL(impl::table_iterator<false>);
184
186 using const_table_iterator = POXY_IMPLEMENTATION_DETAIL(impl::table_iterator<true>);
187
219 class TOML_EXPORTED_CLASS table : public node
220 {
221 private:
223
224 using map_type = std::map<toml::key, impl::node_ptr, std::less<>>;
225 using map_pair = std::pair<const toml::key, impl::node_ptr>;
226 using map_iterator = typename map_type::iterator;
227 using const_map_iterator = typename map_type::const_iterator;
228 map_type map_;
229
230 bool inline_ = false;
231
234 table(const impl::table_init_pair*, const impl::table_init_pair*);
235
237
238 public:
242 table() noexcept;
243
245 ~table() noexcept;
246
250 table(const table&);
251
255 table(table&& other) noexcept;
256
275 explicit table(std::initializer_list<impl::table_init_pair> kvps) //
276 : table(kvps.begin(), kvps.end())
277 {}
278
282
285 table& operator=(table&& rhs) noexcept;
286
289
292 node_type type() const noexcept final
293 {
294 return node_type::table;
295 }
296
299 bool is_homogeneous(node_type ntype) const noexcept final;
300
303 bool is_homogeneous(node_type ntype, node*& first_nonmatch) noexcept final;
304
307 bool is_homogeneous(node_type ntype, const node*& first_nonmatch) const noexcept final;
308
310 template <typename ElemType = void>
312 bool is_homogeneous() const noexcept
313 {
314 using type = impl::remove_cvref<impl::unwrap_node<ElemType>>;
315 static_assert(std::is_void_v<type> || toml::is_value<type> || toml::is_container<type>,
316 "The template type argument of table::is_homogeneous() must be void or one "
317 "of:" TOML_SA_UNWRAPPED_NODE_TYPE_LIST);
318
319 return is_homogeneous(impl::node_type_of<type>);
320 }
322
325 bool is_table() const noexcept final
326 {
327 return true;
328 }
329
332 bool is_array() const noexcept final
333 {
334 return false;
335 }
336
339 bool is_array_of_tables() const noexcept final
340 {
341 return false;
342 }
343
346 bool is_value() const noexcept final
347 {
348 return false;
349 }
350
353 bool is_string() const noexcept final
354 {
355 return false;
356 }
357
360 bool is_integer() const noexcept final
361 {
362 return false;
363 }
364
367 bool is_floating_point() const noexcept final
368 {
369 return false;
370 }
371
374 bool is_number() const noexcept final
375 {
376 return false;
377 }
378
381 bool is_boolean() const noexcept final
382 {
383 return false;
384 }
385
388 bool is_date() const noexcept final
389 {
390 return false;
391 }
392
395 bool is_time() const noexcept final
396 {
397 return false;
398 }
399
402 bool is_date_time() const noexcept final
403 {
404 return false;
405 }
406
408
411
414 table* as_table() noexcept final
415 {
416 return this;
417 }
418
421 array* as_array() noexcept final
422 {
423 return nullptr;
424 }
425
428 toml::value<std::string>* as_string() noexcept final
429 {
430 return nullptr;
431 }
432
435 toml::value<int64_t>* as_integer() noexcept final
436 {
437 return nullptr;
438 }
439
442 toml::value<double>* as_floating_point() noexcept final
443 {
444 return nullptr;
445 }
446
449 toml::value<bool>* as_boolean() noexcept final
450 {
451 return nullptr;
452 }
453
456 toml::value<date>* as_date() noexcept final
457 {
458 return nullptr;
459 }
460
463 toml::value<time>* as_time() noexcept final
464 {
465 return nullptr;
466 }
467
470 toml::value<date_time>* as_date_time() noexcept final
471 {
472 return nullptr;
473 }
474
477 const table* as_table() const noexcept final
478 {
479 return this;
480 }
481
484 const array* as_array() const noexcept final
485 {
486 return nullptr;
487 }
488
491 const toml::value<std::string>* as_string() const noexcept final
492 {
493 return nullptr;
494 }
495
498 const toml::value<int64_t>* as_integer() const noexcept final
499 {
500 return nullptr;
501 }
502
505 const toml::value<double>* as_floating_point() const noexcept final
506 {
507 return nullptr;
508 }
509
512 const toml::value<bool>* as_boolean() const noexcept final
513 {
514 return nullptr;
515 }
516
519 const toml::value<date>* as_date() const noexcept final
520 {
521 return nullptr;
522 }
523
526 const toml::value<time>* as_time() const noexcept final
527 {
528 return nullptr;
529 }
530
533 const toml::value<date_time>* as_date_time() const noexcept final
534 {
535 return nullptr;
536 }
537
539
542
548 bool is_inline() const noexcept
549 {
550 return inline_;
551 }
552
591 void is_inline(bool val) noexcept
592 {
593 inline_ = val;
594 }
595
597
600
627 node* get(std::string_view key) noexcept;
628
635 const node* get(std::string_view key) const noexcept
636 {
637 return const_cast<table&>(*this).get(key);
638 }
639
640#if TOML_ENABLE_WINDOWS_COMPAT
641
650 node* get(std::wstring_view key)
651 {
652 if (empty())
653 return nullptr;
654
655 return get(impl::narrow(key));
656 }
657
666 const node* get(std::wstring_view key) const
667 {
668 return const_cast<table&>(*this).get(key);
669 }
670
671#endif // TOML_ENABLE_WINDOWS_COMPAT
672
692 template <typename T>
694 impl::wrap_node<T>* get_as(std::string_view key) noexcept
695 {
696 const auto n = this->get(key);
697 return n ? n->template as<T>() : nullptr;
698 }
699
706 template <typename T>
708 const impl::wrap_node<T>* get_as(std::string_view key) const noexcept
709 {
710 return const_cast<table&>(*this).template get_as<T>(key);
711 }
712
713#if TOML_ENABLE_WINDOWS_COMPAT
714
723 template <typename T>
725 impl::wrap_node<T>* get_as(std::wstring_view key)
726 {
727 if (empty())
728 return nullptr;
729
730 return get_as<T>(impl::narrow(key));
731 }
732
741 template <typename T>
743 const impl::wrap_node<T>* get_as(std::wstring_view key) const
744 {
745 return const_cast<table&>(*this).template get_as<T>(key);
746 }
747
748#endif // TOML_ENABLE_WINDOWS_COMPAT
749
753 node& at(std::string_view key);
754
757 const node& at(std::string_view key) const
758 {
759 return const_cast<table&>(*this).at(key);
760 }
761
762#if TOML_ENABLE_WINDOWS_COMPAT
763
768 node& at(std::wstring_view key)
769 {
770 return at(impl::narrow(key));
771 }
772
777 const node& at(std::wstring_view key) const
778 {
779 return const_cast<table&>(*this).at(key);
780 }
781
782#endif // TOML_ENABLE_WINDOWS_COMPAT
783
785
788
790 using iterator = toml::table_iterator;
791
793 using const_iterator = toml::const_table_iterator;
794
797 iterator begin() noexcept
798 {
799 return iterator{ map_.begin() };
800 }
801
804 const_iterator begin() const noexcept
805 {
806 return const_iterator{ map_.cbegin() };
807 }
808
811 const_iterator cbegin() const noexcept
812 {
813 return const_iterator{ map_.cbegin() };
814 }
815
818 iterator end() noexcept
819 {
820 return iterator{ map_.end() };
821 }
822
825 const_iterator end() const noexcept
826 {
827 return const_iterator{ map_.cend() };
828 }
829
832 const_iterator cend() const noexcept
833 {
834 return const_iterator{ map_.cend() };
835 }
836
837 private:
839
840 template <typename T, typename Table>
841 using for_each_value_ref = impl::copy_cvref<impl::wrap_node<impl::remove_cvref<impl::unwrap_node<T>>>, Table>;
842
843 template <typename Func, typename Table, typename T>
844 using can_for_each = std::disjunction<std::is_invocable<Func, const key&, for_each_value_ref<T, Table>>, //
845 std::is_invocable<Func, for_each_value_ref<T, Table>>>;
846
847 template <typename Func, typename Table, typename T>
848 using can_for_each_nothrow = std::conditional_t<
849 // first form
850 std::is_invocable_v<Func, const key&, for_each_value_ref<T, Table>>,
851 std::is_nothrow_invocable<Func, const key&, for_each_value_ref<T, Table>>,
852 std::conditional_t<
853 // second form
854 std::is_invocable_v<Func, for_each_value_ref<T, Table>>,
855 std::is_nothrow_invocable<Func, for_each_value_ref<T, Table>>,
856 std::false_type>>;
857
858 template <typename Func, typename Table>
859 using can_for_each_any = std::disjunction<can_for_each<Func, Table, table>,
860 can_for_each<Func, Table, array>,
861 can_for_each<Func, Table, std::string>,
862 can_for_each<Func, Table, int64_t>,
863 can_for_each<Func, Table, double>,
864 can_for_each<Func, Table, bool>,
865 can_for_each<Func, Table, date>,
866 can_for_each<Func, Table, time>,
867 can_for_each<Func, Table, date_time>>;
868
869 template <typename Func, typename Table, typename T>
870 using for_each_is_nothrow_one = std::disjunction<std::negation<can_for_each<Func, Table, T>>, //
871 can_for_each_nothrow<Func, Table, T>>;
872
873 template <typename Func, typename Table>
874 using for_each_is_nothrow = std::conjunction<for_each_is_nothrow_one<Func, Table, table>,
875 for_each_is_nothrow_one<Func, Table, array>,
876 for_each_is_nothrow_one<Func, Table, std::string>,
877 for_each_is_nothrow_one<Func, Table, int64_t>,
878 for_each_is_nothrow_one<Func, Table, double>,
879 for_each_is_nothrow_one<Func, Table, bool>,
880 for_each_is_nothrow_one<Func, Table, date>,
881 for_each_is_nothrow_one<Func, Table, time>,
882 for_each_is_nothrow_one<Func, Table, date_time>>;
883
884 template <typename Func, typename Table>
885 static void do_for_each(Func&& visitor, Table&& tbl) //
886 noexcept(for_each_is_nothrow<Func&&, Table&&>::value)
887 {
888 static_assert(can_for_each_any<Func&&, Table&&>::value,
889 "TOML table for_each visitors must be invocable for at least one of the toml::node "
890 "specializations:" TOML_SA_NODE_TYPE_LIST);
891
892 using kvp_type = impl::copy_cv<map_pair, std::remove_reference_t<Table>>;
893
894 for (kvp_type& kvp : tbl.map_)
895 {
896 using node_ref = impl::copy_cvref<toml::node, Table&&>;
897 static_assert(std::is_reference_v<node_ref>);
898
899#if TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN
900
901#ifndef TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN_ACKNOWLEDGED
902 static_assert(impl::always_false<Func, Table, kvp_type, node_ref>, //
903 TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN_MESSAGE);
904#endif
905
906 static_cast<node_ref>(*kvp.second)
907 .visit(
908 [&]([[maybe_unused]] auto&& v) //
909 noexcept(for_each_is_nothrow_one<Func&&, Table&&, decltype(v)>::value)
910 {
911 using value_ref = for_each_value_ref<decltype(v), Table&&>;
912 static_assert(std::is_reference_v<value_ref>);
913
914 // func(key, val)
915 if constexpr (std::is_invocable_v<Func&&, const key&, value_ref>)
916 {
917 static_cast<Func&&>(visitor)(static_cast<const key&>(kvp.first),
918 static_cast<value_ref>(v));
919 }
920
921 // func(val)
922 else if constexpr (std::is_invocable_v<Func&&, value_ref>)
923 {
924 static_cast<Func&&>(visitor)(static_cast<value_ref>(v));
925 }
926 });
927
928#else
929 const auto keep_going =
930 static_cast<node_ref>(*kvp.second)
931 .visit(
932 [&]([[maybe_unused]] auto&& v) //
933 noexcept(for_each_is_nothrow_one<Func&&, Table&&, decltype(v)>::value)
934 {
935 using value_ref = for_each_value_ref<decltype(v), Table&&>;
936 static_assert(std::is_reference_v<value_ref>);
937
938 // func(key, val)
939 if constexpr (std::is_invocable_v<Func&&, const key&, value_ref>)
940 {
941 using return_type = decltype(static_cast<Func&&>(
942 visitor)(static_cast<const key&>(kvp.first), static_cast<value_ref>(v)));
943
944 if constexpr (impl::is_constructible_or_convertible<bool, return_type>)
945 {
946 return static_cast<bool>(static_cast<Func&&>(
947 visitor)(static_cast<const key&>(kvp.first), static_cast<value_ref>(v)));
948 }
949 else
950 {
951 static_cast<Func&&>(visitor)(static_cast<const key&>(kvp.first),
952 static_cast<value_ref>(v));
953 return true;
954 }
955 }
956
957 // func(val)
958 else if constexpr (std::is_invocable_v<Func&&, value_ref>)
959 {
960 using return_type =
961 decltype(static_cast<Func&&>(visitor)(static_cast<value_ref>(v)));
962
963 if constexpr (impl::is_constructible_or_convertible<bool, return_type>)
964 {
965 return static_cast<bool>(
966 static_cast<Func&&>(visitor)(static_cast<value_ref>(v)));
967 }
968 else
969 {
970 static_cast<Func&&>(visitor)(static_cast<value_ref>(v));
971 return true;
972 }
973 }
974
975 // visitor not compatible with this particular type
976 else
977 return true;
978 });
979
980 if (!keep_going)
981 return;
982#endif
983 }
984 }
985
987
988 public:
1070 template <typename Func>
1071 table& for_each(Func&& visitor) & //
1072 noexcept(for_each_is_nothrow<Func&&, table&>::value)
1073 {
1074 do_for_each(static_cast<Func&&>(visitor), *this);
1075 return *this;
1076 }
1077
1079 template <typename Func>
1080 table&& for_each(Func&& visitor) && //
1081 noexcept(for_each_is_nothrow<Func&&, table&&>::value)
1082 {
1083 do_for_each(static_cast<Func&&>(visitor), static_cast<table&&>(*this));
1084 return static_cast<table&&>(*this);
1085 }
1086
1088 template <typename Func>
1089 const table& for_each(Func&& visitor) const& //
1090 noexcept(for_each_is_nothrow<Func&&, const table&>::value)
1091 {
1092 do_for_each(static_cast<Func&&>(visitor), *this);
1093 return *this;
1094 }
1095
1097 template <typename Func>
1098 const table&& for_each(Func&& visitor) const&& //
1099 noexcept(for_each_is_nothrow<Func&&, const table&&>::value)
1100 {
1101 do_for_each(static_cast<Func&&>(visitor), static_cast<const table&&>(*this));
1102 return static_cast<const table&&>(*this);
1103 }
1104
1106
1109
1112 bool empty() const noexcept
1113 {
1114 return map_.empty();
1115 }
1116
1119 size_t size() const noexcept
1120 {
1121 return map_.size();
1122 }
1123
1125
1128
1129 private:
1131
1134 map_iterator get_lower_bound(std::string_view) noexcept;
1135
1137
1138 public:
1143 iterator lower_bound(std::string_view key) noexcept
1144 {
1145 return iterator{ get_lower_bound(key) };
1146 }
1147
1152 const_iterator lower_bound(std::string_view key) const noexcept
1153 {
1154 return const_iterator{ const_cast<table&>(*this).get_lower_bound(key) };
1155 }
1156
1157#if TOML_ENABLE_WINDOWS_COMPAT
1158
1165 iterator lower_bound(std::wstring_view key)
1166 {
1167 if (empty())
1168 return end();
1169
1170 return lower_bound(impl::narrow(key));
1171 }
1172
1179 const_iterator lower_bound(std::wstring_view key) const
1180 {
1181 if (empty())
1182 return end();
1183
1184 return lower_bound(impl::narrow(key));
1185 }
1186
1187#endif // TOML_ENABLE_WINDOWS_COMPAT
1188
1196 iterator find(std::string_view key) noexcept;
1197
1205 const_iterator find(std::string_view key) const noexcept;
1206
1209 bool contains(std::string_view key) const noexcept
1210 {
1211 return get(key) != nullptr;
1212 }
1213
1214#if TOML_ENABLE_WINDOWS_COMPAT
1215
1224 iterator find(std::wstring_view key)
1225 {
1226 if (empty())
1227 return end();
1228
1229 return find(impl::narrow(key));
1230 }
1231
1240 const_iterator find(std::wstring_view key) const
1241 {
1242 return find(impl::narrow(key));
1243 }
1244
1249 bool contains(std::wstring_view key) const
1250 {
1251 return contains(impl::narrow(key));
1252 }
1253
1254#endif // TOML_ENABLE_WINDOWS_COMPAT
1255
1257
1260
1261 private:
1263
1265 map_iterator erase(const_map_iterator) noexcept;
1266
1268 map_iterator erase(const_map_iterator, const_map_iterator) noexcept;
1269
1271
1272 public:
1296 {
1297 return iterator{ erase(const_map_iterator{ pos }) };
1298 }
1299
1323 {
1324 return iterator{ erase(const_map_iterator{ pos }) };
1325 }
1326
1352 {
1353 return iterator{ erase(const_map_iterator{ begin }, const_map_iterator{ end }) };
1354 }
1355
1382 size_t erase(std::string_view key) noexcept;
1383
1384#if TOML_ENABLE_WINDOWS_COMPAT
1385
1393 size_t erase(std::wstring_view key)
1394 {
1395 if (empty())
1396 return false;
1397
1398 return erase(impl::narrow(key));
1399 }
1400
1401#endif // TOML_ENABLE_WINDOWS_COMPAT
1402
1423 table& prune(bool recursive = true) & noexcept;
1424
1430 table&& prune(bool recursive = true) && noexcept
1431 {
1432 return static_cast<toml::table&&>(this->prune(recursive));
1433 }
1434
1437 void clear() noexcept;
1438
1440
1443
1444 private:
1446
1448 map_iterator insert_with_hint(const_iterator, key&&, impl::node_ptr&&);
1449
1451
1452 public:
1465 TOML_CONSTRAINED_TEMPLATE((is_key_or_convertible<KeyType&&> || impl::is_wide_string<KeyType>),
1466 typename ValueType = void,
1467 typename KeyType,
1468 typename... ValueArgs)
1469 iterator emplace_hint(const_iterator hint, KeyType&& key, ValueArgs&&... args)
1470 {
1471 static_assert(!impl::is_wide_string<KeyType> || TOML_ENABLE_WINDOWS_COMPAT,
1472 "Emplacement using wide-character keys is only supported on Windows with "
1473 "TOML_ENABLE_WINDOWS_COMPAT enabled.");
1474
1475 using raw_value_type = impl::remove_cvref<ValueType>;
1476 using value_type = std::
1477 conditional_t<std::is_void_v<raw_value_type>, impl::emplaced_type_of<ValueArgs&&...>, raw_value_type>;
1478
1479 if constexpr (impl::is_wide_string<KeyType>)
1480 {
1481#if TOML_ENABLE_WINDOWS_COMPAT
1482 return emplace_hint<value_type>(hint,
1483 impl::narrow(static_cast<KeyType&&>(key)),
1484 static_cast<ValueArgs&&>(args)...);
1485#else
1486 static_assert(impl::always_false<KeyType>, "Evaluated unreachable branch!");
1487#endif
1488 }
1489 else
1490 {
1491 static constexpr auto moving_node_ptr = std::is_same_v<value_type, impl::node_ptr> //
1492 && sizeof...(ValueArgs) == 1u //
1493 && impl::first_is_same<impl::node_ptr&&, ValueArgs&&...>;
1494 using unwrapped_type = impl::remove_cvref<impl::unwrap_node<value_type>>;
1495
1496 static_assert(moving_node_ptr //
1497 || impl::is_native<unwrapped_type> //
1498 || impl::is_one_of<unwrapped_type, table, array>, //
1499 "ValueType argument of table::emplace_hint() must be one "
1500 "of:" TOML_SA_UNWRAPPED_NODE_TYPE_LIST);
1501
1502 map_iterator ipos = insert_with_hint(hint, toml::key{ static_cast<KeyType&&>(key) }, nullptr);
1503
1504 // if second is nullptr then we successully claimed the key and inserted the empty sentinel,
1505 // so now we have to construct the actual value
1506 if (!ipos->second)
1507 {
1508 if constexpr (moving_node_ptr)
1509 ipos->second = std::move(static_cast<ValueArgs&&>(args)...);
1510 else
1511 {
1512#if TOML_COMPILER_HAS_EXCEPTIONS
1513 try
1514 {
1515#endif
1516 ipos->second.reset(
1517 new impl::wrap_node<unwrapped_type>{ static_cast<ValueArgs&&>(args)... });
1518#if TOML_COMPILER_HAS_EXCEPTIONS
1519 }
1520 catch (...)
1521 {
1522 erase(const_map_iterator{ ipos }); // strong exception guarantee
1523 throw;
1524 }
1525#endif
1526 }
1527 }
1528 return iterator{ ipos };
1529 }
1530 }
1531
1583 TOML_CONSTRAINED_TEMPLATE((is_key_or_convertible<KeyType&&> || impl::is_wide_string<KeyType>),
1584 typename KeyType,
1585 typename ValueType)
1586 std::pair<iterator, bool> insert(KeyType&& key,
1587 ValueType&& val,
1589 {
1590 static_assert(!impl::is_wide_string<KeyType> || TOML_ENABLE_WINDOWS_COMPAT,
1591 "Insertion using wide-character keys is only supported on Windows with "
1592 "TOML_ENABLE_WINDOWS_COMPAT enabled.");
1593
1594 if constexpr (is_node_view<ValueType>)
1595 {
1596 if (!val)
1597 return { end(), false };
1598 }
1599
1600 if constexpr (impl::is_wide_string<KeyType>)
1601 {
1602#if TOML_ENABLE_WINDOWS_COMPAT
1603 return insert(impl::narrow(static_cast<KeyType&&>(key)), static_cast<ValueType&&>(val), flags);
1604#else
1605 static_assert(impl::always_false<KeyType>, "Evaluated unreachable branch!");
1606#endif
1607 }
1608 else
1609 {
1610 const auto key_view = std::string_view{ key };
1611 map_iterator ipos = get_lower_bound(key_view);
1612 if (ipos == map_.end() || ipos->first != key_view)
1613 {
1614 ipos = insert_with_hint(const_iterator{ ipos },
1615 toml::key{ static_cast<KeyType&&>(key) },
1616 impl::make_node(static_cast<ValueType&&>(val), flags));
1617 return { iterator{ ipos }, true };
1618 }
1619 return { iterator{ ipos }, false };
1620 }
1621 }
1622
1662 TOML_CONSTRAINED_TEMPLATE((!is_key_or_convertible<Iter> && !impl::is_wide_string<Iter>), typename Iter)
1663 void insert(Iter begin, Iter end, value_flags flags = preserve_source_value_flags)
1664 {
1665 if (begin == end)
1666 return;
1667 for (auto it = begin; it != end; it++)
1668 {
1669 if constexpr (std::is_rvalue_reference_v<decltype(*it)>)
1670 insert(std::move((*it).first), std::move((*it).second), flags);
1671 else
1672 insert((*it).first, (*it).second, flags);
1673 }
1674 }
1675
1728 TOML_CONSTRAINED_TEMPLATE((is_key_or_convertible<KeyType&&> || impl::is_wide_string<KeyType>),
1729 typename KeyType,
1730 typename ValueType)
1731 std::pair<iterator, bool> insert_or_assign(KeyType&& key,
1732 ValueType&& val,
1734 {
1735 static_assert(!impl::is_wide_string<KeyType> || TOML_ENABLE_WINDOWS_COMPAT,
1736 "Insertion using wide-character keys is only supported on Windows with "
1737 "TOML_ENABLE_WINDOWS_COMPAT enabled.");
1738
1739 if constexpr (is_node_view<ValueType>)
1740 {
1741 if (!val)
1742 return { end(), false };
1743 }
1744
1745 if constexpr (impl::is_wide_string<KeyType>)
1746 {
1747#if TOML_ENABLE_WINDOWS_COMPAT
1748 return insert_or_assign(impl::narrow(static_cast<KeyType&&>(key)),
1749 static_cast<ValueType&&>(val),
1750 flags);
1751#else
1752 static_assert(impl::always_false<KeyType>, "Evaluated unreachable branch!");
1753#endif
1754 }
1755 else
1756 {
1757 const auto key_view = std::string_view{ key };
1758 map_iterator ipos = get_lower_bound(key_view);
1759 if (ipos == map_.end() || ipos->first != key_view)
1760 {
1761 ipos = insert_with_hint(const_iterator{ ipos },
1762 toml::key{ static_cast<KeyType&&>(key) },
1763 impl::make_node(static_cast<ValueType&&>(val), flags));
1764 return { iterator{ ipos }, true };
1765 }
1766 else
1767 {
1768 (*ipos).second = impl::make_node(static_cast<ValueType&&>(val), flags);
1769 return { iterator{ ipos }, false };
1770 }
1771 }
1772 }
1773
1811 TOML_CONSTRAINED_TEMPLATE((is_key_or_convertible<KeyType&&> || impl::is_wide_string<KeyType>),
1812 typename ValueType = void,
1813 typename KeyType,
1814 typename... ValueArgs)
1815 std::pair<iterator, bool> emplace(KeyType&& key, ValueArgs&&... args)
1816 {
1817 static_assert(!impl::is_wide_string<KeyType> || TOML_ENABLE_WINDOWS_COMPAT,
1818 "Emplacement using wide-character keys is only supported on Windows with "
1819 "TOML_ENABLE_WINDOWS_COMPAT enabled.");
1820
1821 using raw_value_type = impl::remove_cvref<ValueType>;
1822 using value_type = std::
1823 conditional_t<std::is_void_v<raw_value_type>, impl::emplaced_type_of<ValueArgs&&...>, raw_value_type>;
1824
1825 if constexpr (impl::is_wide_string<KeyType>)
1826 {
1827#if TOML_ENABLE_WINDOWS_COMPAT
1828 return emplace<value_type>(impl::narrow(static_cast<KeyType&&>(key)),
1829 static_cast<ValueArgs&&>(args)...);
1830#else
1831 static_assert(impl::always_false<KeyType>, "Evaluated unreachable branch!");
1832#endif
1833 }
1834 else
1835 {
1836 using unwrapped_type = impl::remove_cvref<impl::unwrap_node<value_type>>;
1837 static_assert((impl::is_native<unwrapped_type> || impl::is_one_of<unwrapped_type, table, array>),
1838 "ValueType argument of table::emplace() must be one "
1839 "of:" TOML_SA_UNWRAPPED_NODE_TYPE_LIST);
1840
1841 const auto key_view = std::string_view{ key };
1842 auto ipos = get_lower_bound(key_view);
1843 if (ipos == map_.end() || ipos->first != key_view)
1844 {
1845 ipos = insert_with_hint(
1846 const_iterator{ ipos },
1847 toml::key{ static_cast<KeyType&&>(key) },
1848 impl::node_ptr{ new impl::wrap_node<unwrapped_type>{ static_cast<ValueArgs&&>(args)... } });
1849 return { iterator{ ipos }, true };
1850 }
1851 return { iterator{ ipos }, false };
1852 }
1853 }
1854
1856
1859
1861 using node::operator[]; // inherit operator[toml::path]
1863
1876 node_view<node> operator[](std::string_view key) noexcept
1877 {
1878 return node_view<node>{ get(key) };
1879 }
1880
1893 node_view<const node> operator[](std::string_view key) const noexcept
1894 {
1895 return node_view<const node>{ get(key) };
1896 }
1897
1898#if TOML_ENABLE_WINDOWS_COMPAT
1899
1914 node_view<node> operator[](std::wstring_view key)
1915 {
1916 return node_view<node>{ get(key) };
1917 }
1918
1933 node_view<const node> operator[](std::wstring_view key) const
1934 {
1935 return node_view<const node>{ get(key) };
1936 }
1937
1938#endif // TOML_ENABLE_WINDOWS_COMPAT
1939
1941
1944
1945 private:
1947
1950 static bool TOML_CALLCONV equal(const table&, const table&) noexcept;
1951
1953 public:
1961 friend bool operator==(const table& lhs, const table& rhs) noexcept
1962 {
1963 return equal(lhs, rhs);
1964 }
1965
1973 friend bool operator!=(const table& lhs, const table& rhs) noexcept
1974 {
1975 return !equal(lhs, rhs);
1976 }
1977
1979
1980#if TOML_ENABLE_FORMATTERS
1981
1985 friend std::ostream& operator<<(std::ostream& lhs, const table& rhs)
1986 {
1987 impl::print_to_stream(lhs, rhs);
1988 return lhs;
1989 }
1990
1991#endif
1992 };
1993}
1995
1996#include "header_end.hpp"
A TOML array.
Definition array.hpp:285
A TOML table.
Definition table.hpp:220
TOML_PURE_INLINE_GETTER const_iterator begin() const noexcept
Returns an iterator to the first key-value pair.
Definition table.hpp:804
TOML_EXPORTED_MEMBER_FUNCTION table & prune(bool recursive=true) &noexcept
Removes empty child arrays and tables.
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION bool is_homogeneous(node_type ntype, node *&first_nonmatch) noexcept final
TOML_NODISCARD const impl::wrap_node< T > * get_as(std::wstring_view key) const
Gets the node at a specific key if it is a particular type (const overload).
Definition table.hpp:743
TOML_CONST_INLINE_GETTER bool is_date_time() const noexcept final
Returns false.
Definition table.hpp:402
TOML_NODISCARD node * get(std::wstring_view key)
Gets the node at a specific key.
Definition table.hpp:650
TOML_NODISCARD const node & at(std::string_view key) const
Gets a reference to the element at a specific key, throwing std::out_of_range if none existed.
Definition table.hpp:757
TOML_NODISCARD TOML_EXPORTED_MEMBER_FUNCTION node & at(std::string_view key)
Gets a reference to the element at a specific key, throwing std::out_of_range if none existed.
TOML_CONST_INLINE_GETTER bool is_string() const noexcept final
Returns false.
Definition table.hpp:353
TOML_PURE_INLINE_GETTER const node * get(std::string_view key) const noexcept
Gets the node at a specific key (const overload).
Definition table.hpp:635
TOML_CONST_INLINE_GETTER const toml::value< std::string > * as_string() const noexcept final
Returns nullptr.
Definition table.hpp:491
TOML_NODISCARD bool contains(std::wstring_view key) const
Returns true if the table contains a node at the given key.
Definition table.hpp:1249
TOML_CONST_INLINE_GETTER bool is_number() const noexcept final
Returns false.
Definition table.hpp:374
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION table() noexcept
Default constructor.
TOML_NODISCARD impl::wrap_node< T > * get_as(std::wstring_view key)
Gets the node at a specific key if it is a particular type.
Definition table.hpp:725
iterator erase(const_iterator pos) noexcept
Removes the specified key-value pair from the table (const iterator overload).
Definition table.hpp:1322
table && for_each(Func &&visitor) &&noexcept(for_each_is_nothrow< Func &&, table && >::value)
Invokes a visitor on each key-value pair in the table (rvalue overload).
Definition table.hpp:1080
TOML_CONST_INLINE_GETTER const toml::value< double > * as_floating_point() const noexcept final
Returns nullptr.
Definition table.hpp:505
TOML_CONST_INLINE_GETTER toml::value< bool > * as_boolean() noexcept final
Returns nullptr.
Definition table.hpp:449
size_t erase(std::wstring_view key)
Removes the value with the given key from the table.
Definition table.hpp:1393
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION node * get(std::string_view key) noexcept
Gets the node at a specific key.
TOML_CONST_INLINE_GETTER const toml::value< int64_t > * as_integer() const noexcept final
Returns nullptr.
Definition table.hpp:498
table & for_each(Func &&visitor) &noexcept(for_each_is_nothrow< Func &&, table & >::value)
Invokes a visitor on each key-value pair in the table.
Definition table.hpp:1071
TOML_PURE_INLINE_GETTER bool empty() const noexcept
Returns true if the table is empty.
Definition table.hpp:1112
TOML_CONST_INLINE_GETTER const toml::value< time > * as_time() const noexcept final
Returns nullptr.
Definition table.hpp:526
TOML_NODISCARD node_view< node > operator[](std::wstring_view key)
Gets a node_view for the selected value.
Definition table.hpp:1914
TOML_PURE_GETTER bool contains(std::string_view key) const noexcept
Returns true if the table contains a node at the given key.
Definition table.hpp:1209
const table && for_each(Func &&visitor) const &&noexcept(for_each_is_nothrow< Func &&, const table && >::value)
Invokes a visitor on each key-value pair in the table (const rvalue overload).
Definition table.hpp:1098
TOML_CONST_INLINE_GETTER bool is_array() const noexcept final
Returns false.
Definition table.hpp:332
TOML_CONST_INLINE_GETTER node_type type() const noexcept final
Returns #toml::node_type::table.
Definition table.hpp:292
TOML_CONST_INLINE_GETTER array * as_array() noexcept final
Returns nullptr.
Definition table.hpp:421
iterator erase(const_iterator begin, const_iterator end) noexcept
Removes the key-value pairs in the range [first, last) from the table.
Definition table.hpp:1351
TOML_NODISCARD const node & at(std::wstring_view key) const
Gets a reference to the element at a specific key, throwing std::out_of_range if none existed.
Definition table.hpp:777
toml::const_table_iterator const_iterator
A BidirectionalIterator for iterating over const key-value pairs in a toml::table.
Definition table.hpp:793
TOML_NODISCARD node_view< const node > operator[](std::wstring_view key) const
Gets a node_view for the selected value (const overload).
Definition table.hpp:1933
TOML_EXPORTED_MEMBER_FUNCTION table & operator=(table &&rhs) noexcept
Move-assignment operator.
TOML_EXPORTED_MEMBER_FUNCTION size_t erase(std::string_view key) noexcept
Removes the value with the given key from the table.
TOML_PURE_GETTER impl::wrap_node< T > * get_as(std::string_view key) noexcept
Gets the node at a specific key if it is a particular type.
Definition table.hpp:694
TOML_EXPORTED_MEMBER_FUNCTION void clear() noexcept
Removes all key-value pairs from the table.
toml::table_iterator iterator
A BidirectionalIterator for iterating over key-value pairs in a toml::table.
Definition table.hpp:790
TOML_NODISCARD node_view< node > operator[](std::string_view key) noexcept
Gets a node_view for the selected value.
Definition table.hpp:1876
impl::remove_cvref< ValueType > raw_value_type
Definition table.hpp:1475
TOML_CONSTRAINED_TEMPLATE((is_key_or_convertible< KeyType && >||impl::is_wide_string< KeyType >), typename ValueType=void, typename KeyType, typename... ValueArgs) std
Emplaces a new value at a specific key if one did not already exist.
Definition table.hpp:1811
TOML_PURE_GETTER const_iterator lower_bound(std::string_view key) const noexcept
Returns a const iterator to the first key-value pair with key that is not less than the given key.
Definition table.hpp:1152
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION bool is_homogeneous(node_type ntype) const noexcept final
TOML_CONST_INLINE_GETTER table * as_table() noexcept final
Returns a pointer to the table.
Definition table.hpp:414
TOML_EXPORTED_MEMBER_FUNCTION table & operator=(const table &)
Copy-assignment operator.
TOML_CONST_INLINE_GETTER toml::value< time > * as_time() noexcept final
Returns nullptr.
Definition table.hpp:463
TOML_PURE_INLINE_GETTER const_iterator end() const noexcept
Returns an iterator to one-past-the-last key-value pair.
Definition table.hpp:825
TOML_CONST_INLINE_GETTER const toml::value< date_time > * as_date_time() const noexcept final
Returns nullptr.
Definition table.hpp:533
TOML_PURE_INLINE_GETTER iterator begin() noexcept
Returns an iterator to the first key-value pair.
Definition table.hpp:797
TOML_NODISCARD node_view< const node > operator[](std::string_view key) const noexcept
Gets a node_view for the selected value (const overload).
Definition table.hpp:1893
TOML_CONST_INLINE_GETTER bool is_table() const noexcept final
Returns true.
Definition table.hpp:325
TOML_CONST_INLINE_GETTER bool is_value() const noexcept final
Returns false.
Definition table.hpp:346
TOML_NODISCARD friend bool operator==(const table &lhs, const table &rhs) noexcept
Equality operator.
Definition table.hpp:1961
TOML_CONST_INLINE_GETTER const table * as_table() const noexcept final
Returns a const-qualified pointer to the table.
Definition table.hpp:477
friend std::ostream & operator<<(std::ostream &lhs, const table &rhs)
Prints the table out to a stream as formatted TOML.
Definition table.hpp:1985
TOML_CONST_INLINE_GETTER bool is_boolean() const noexcept final
Returns false.
Definition table.hpp:381
TOML_CONSTRAINED_TEMPLATE((is_key_or_convertible< KeyType && >||impl::is_wide_string< KeyType >), typename KeyType, typename ValueType) std
Inserts a new value at a specific key if one did not already exist.
Definition table.hpp:1583
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION const_iterator find(std::string_view key) const noexcept
Gets an iterator to the node at a specific key (const overload)
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION iterator find(std::string_view key) noexcept
Gets an iterator to the node at a specific key.
TOML_NODISCARD iterator find(std::wstring_view key)
Gets an iterator to the node at a specific key.
Definition table.hpp:1224
TOML_CONST_INLINE_GETTER toml::value< int64_t > * as_integer() noexcept final
Returns nullptr.
Definition table.hpp:435
TOML_NODISCARD const_iterator lower_bound(std::wstring_view key) const
Returns a const iterator to the first key-value pair with key that is not less than the given key.
Definition table.hpp:1179
const table & for_each(Func &&visitor) const &noexcept(for_each_is_nothrow< Func &&, const table & >::value)
Invokes a visitor on each key-value pair in the table (const lvalue overload).
Definition table.hpp:1089
table && prune(bool recursive=true) &&noexcept
Removes empty child arrays and tables (rvalue overload).
Definition table.hpp:1430
TOML_CONST_INLINE_GETTER bool is_floating_point() const noexcept final
Returns false.
Definition table.hpp:367
TOML_PURE_INLINE_GETTER const_iterator cbegin() const noexcept
Returns an iterator to the first key-value pair.
Definition table.hpp:811
TOML_CONST_INLINE_GETTER bool is_date() const noexcept final
Returns false.
Definition table.hpp:388
TOML_PURE_INLINE_GETTER iterator end() noexcept
Returns an iterator to one-past-the-last key-value pair.
Definition table.hpp:818
impl::remove_cvref< impl::unwrap_node< value_type > > unwrapped_type
Definition table.hpp:1494
TOML_CONST_INLINE_GETTER toml::value< date > * as_date() noexcept final
Returns nullptr.
Definition table.hpp:456
TOML_PURE_INLINE_GETTER bool is_inline() const noexcept
Returns true if this table is an inline table.
Definition table.hpp:548
TOML_CONST_INLINE_GETTER const array * as_array() const noexcept final
Returns nullptr.
Definition table.hpp:484
TOML_PURE_GETTER const impl::wrap_node< T > * get_as(std::string_view key) const noexcept
Gets the node at a specific key if it is a particular type (const overload).
Definition table.hpp:708
TOML_NODISCARD friend bool operator!=(const table &lhs, const table &rhs) noexcept
Inequality operator.
Definition table.hpp:1973
TOML_CONST_INLINE_GETTER const toml::value< date > * as_date() const noexcept final
Returns nullptr.
Definition table.hpp:519
TOML_NODISCARD const_iterator find(std::wstring_view key) const
Gets an iterator to the node at a specific key (const overload).
Definition table.hpp:1240
TOML_CONST_INLINE_GETTER toml::value< double > * as_floating_point() noexcept final
Returns nullptr.
Definition table.hpp:442
TOML_PURE_GETTER iterator lower_bound(std::string_view key) noexcept
Returns an iterator to the first key-value pair with key that is not less than the given key.
Definition table.hpp:1143
TOML_CONST_INLINE_GETTER toml::value< date_time > * as_date_time() noexcept final
Returns nullptr.
Definition table.hpp:470
TOML_NODISCARD iterator lower_bound(std::wstring_view key)
Returns an iterator to the first key-value pair with key that is not less than the given key.
Definition table.hpp:1165
TOML_PURE_GETTER TOML_EXPORTED_MEMBER_FUNCTION bool is_homogeneous(node_type ntype, const node *&first_nonmatch) const noexcept final
TOML_PURE_GETTER bool is_array_of_tables() const noexcept final
Returns false.
Definition table.hpp:339
TOML_CONST_INLINE_GETTER bool is_integer() const noexcept final
Returns false.
Definition table.hpp:360
TOML_CONST_INLINE_GETTER const toml::value< bool > * as_boolean() const noexcept final
Returns nullptr.
Definition table.hpp:512
void is_inline(bool val) noexcept
Sets whether this table is a TOML inline table.
Definition table.hpp:591
TOML_PURE_INLINE_GETTER const_iterator cend() const noexcept
Returns an iterator to one-past-the-last key-value pair.
Definition table.hpp:832
TOML_NODISCARD const node * get(std::wstring_view key) const
Gets the node at a specific key (const overload).
Definition table.hpp:666
TOML_CONST_INLINE_GETTER bool is_time() const noexcept final
Returns false.
Definition table.hpp:395
TOML_CONST_INLINE_GETTER toml::value< std::string > * as_string() noexcept final
Returns nullptr.
Definition table.hpp:428
TOML_NODISCARD node & at(std::wstring_view key)
Gets a reference to the element at a specific key, throwing std::out_of_range if none existed.
Definition table.hpp:768
std::conditional_t< std::is_void_v< raw_value_type >, impl::emplaced_type_of< ValueArgs &&... >, raw_value_type > value_type
Definition table.hpp:1477
iterator erase(iterator pos) noexcept
Removes the specified key-value pair from the table.
Definition table.hpp:1295
TOML_PURE_INLINE_GETTER size_t size() const noexcept
Returns the number of key-value pairs in the table.
Definition table.hpp:1119
enum TOML_OPEN_FLAGS_ENUM value_flags
Metadata associated with TOML values.
Definition forward_declarations.hpp:272
constexpr value_flags preserve_source_value_flags
Special #toml::value_flags constant used for array + table insert functions to specify that any value...
Definition forward_declarations.hpp:290
#define TOML_CALLCONV
Calling convention to apply to exported free/static functions. \detail Not defined by default (let th...
Definition preprocessor.hpp:1134
#define TOML_EXPORTED_CLASS
An 'export' annotation to add to classes. \detail Not defined by default.
Definition preprocessor.hpp:979
#define TOML_EXPORTED_STATIC_FUNCTION
An 'export' annotation to add to static class member functions. \detail Not defined by default.
Definition preprocessor.hpp:985
#define TOML_ENABLE_WINDOWS_COMPAT
Enables the use of wide strings (wchar_t, std::wstring) in various places throughout the library when...
Definition preprocessor.hpp:1074
#define TOML_EXPORTED_MEMBER_FUNCTION
An 'export' annotation to add to non-static class member functions. \detail Not defined by default.
Definition preprocessor.hpp:982
bool operator==(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition json.h:14737
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition json.h:14762
constexpr bool is_key_or_convertible
Metafunction for determining if a type is, or is a reference to, a toml::key, or is implicitly or exp...
Definition key.hpp:330
@ value
the parser finished reading a JSON value
@ key
the parser read a key of a value in an object
Definition json.h:5363
#define TOML_NODISCARD_CTOR
Definition preprocessor.hpp:446
#define POXY_IMPLEMENTATION_DETAIL(...)
Definition preprocessor.hpp:633
#define TOML_CONSTRAINED_TEMPLATE(condition,...)
Definition preprocessor.hpp:1260
#define TOML_NODISCARD
Definition preprocessor.hpp:439
#define TOML_PURE_GETTER
Definition preprocessor.hpp:474
#define TOML_PURE_INLINE_GETTER
Definition preprocessor.hpp:479
#define TOML_IMPL_NAMESPACE_END
Definition preprocessor.hpp:1334
#define TOML_IMPL_NAMESPACE_START
Definition preprocessor.hpp:1333
#define TOML_CONST_INLINE_GETTER
Definition preprocessor.hpp:490
#define TOML_LAUNDER(x)
Definition std_new.hpp:17
TOML_NAMESPACE_START
Definition table.hpp:181
POXY_IMPLEMENTATION_DETAIL(impl::table_iterator< true >) const_table_iterator
A BidirectionalIterator for iterating over const key-value pairs in a toml::table.
Definition table.hpp:186
TOML_NAMESPACE_END
Definition table.hpp:1994