This commit is contained in:
nlohmann committed 2026-10-26 21:24:35 +00:00
1 parent 41c601a7d1
commit d2e264bd84
1400 files changed
+11859 -5440

No files matched your search

+7 -7
View File
@@ -38,7 +38,7 @@ Consider the following example code where the pointer `ptr` changes after the ar
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using nlohmann::json;
int main()
{
@@ -70,7 +70,7 @@ The example below shows how pointers to internal values of a JSON value can be r
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using nlohmann::json;
int main()
{
@@ -78,11 +78,11 @@ int main()
json value = 17;
// explicitly getting pointers
auto p1 = value.get_ptr<const json::number_integer_t*>();
auto p2 = value.get_ptr<json::number_integer_t*>();
auto p3 = value.get_ptr<json::number_integer_t* const>();
auto p4 = value.get_ptr<const json::number_integer_t* const>();
auto p5 = value.get_ptr<json::number_float_t*>();
const auto* p1 = value.get_ptr<const json::number_integer_t*>();
auto* p2 = value.get_ptr<json::number_integer_t*>();
auto* p3 = value.get_ptr<json::number_integer_t* const>();
const auto* p4 = value.get_ptr<const json::number_integer_t* const>();
auto* p5 = value.get_ptr<json::number_float_t*>();
// print the pointees
std::cout << *p1 << ' ' << *p2 << ' ' << *p3 << ' ' << *p4 << '\n';