jamboree / bustache

C++20 implementation of {{ mustache }}
82 stars 10 forks source link

How to search Bustache Object for data? #20

Closed carolinebeltran closed 4 years ago

carolinebeltran commented 4 years ago

I've been using Bustache templates with great success. Now, I would also like to use Bustache Object as a container for storing and searching for data but I am having problems finding the second value as you can see here:

// find a key in the Bustache container auto result = bustObj.find("1IX99OAVFXOA");

// display the first value std::cout << result->first << std::endl; // 1IX99OAVFXOA

// display the second value //std::cout << result->second << std::endl; // compiler error bustache::value x = result->second;

I cannot figure out how to obtain the second value, please help me.

Thank you

jamboree commented 4 years ago

You already know how to search, don't you? Your problem is about how to print the value.

Here's a simple demo for you: https://wandbox.org/permlink/XLq3GkYhw5VMkt8x

carolinebeltran commented 4 years ago

Jamboree, thank you so much! What a complex but powerful library you have built!