From 6ffd233bce13ca66e3e0d21928132f7410ad789f Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sun, 16 Apr 2017 16:38:02 +0900 Subject: [PATCH] add table and array --- test.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/test.cpp b/test.cpp index a1d7759..d017195 100644 --- a/test.cpp +++ b/test.cpp @@ -10,13 +10,30 @@ int main() toml::value v3(f); toml::value v4("hoge"); - std::cout << "v1: " << v1.t() << " = " << v1.cast() << std::endl; - std::cout << "v2: " << v2.t() << " = " << v2.cast() << std::endl; - std::cout << "v3: " << v3.t() << " = " << v3.cast() << std::endl; - std::cout << "v4: " << v4.t() << " = " << v4.cast() << std::endl; + std::cout << "v1: " << v1.type() << " = " << v1.cast() << std::endl; + std::cout << "v2: " << v2.type() << " = " << v2.cast() << std::endl; + std::cout << "v3: " << v3.type() << " = " << v3.cast() << std::endl; + std::cout << "v4: " << v4.type() << " = " << v4.cast() << std::endl; v1.reset(f); - std::cout << "v1: " << v1.t() << " = " << v1.cast() << std::endl; + std::cout << "v1: " << v1.type() << " = " << v1.cast() << std::endl; + toml::Table tab; + tab["v1"] = v1; + tab["v2"] = v2; + tab["v3"] = v3; + tab["v4"] = v4; + + toml::Array arr; + arr.emplace_back(3); + arr.emplace_back(1); + arr.emplace_back(4); + arr.emplace_back(1); + arr.emplace_back(5); + + toml::value v5(tab); + std::cout << "v5: " << v5.type() << std::endl; + toml::value v6(arr); + std::cout << "v6: " << v6.type() << std::endl; return 0; }