Function insert

Summary

#include <include/cpptoml.h>

(1) void insert(const std::string &key, const std::shared_ptr< base > &value)

(2) template <class T>
    void insert(const std::string &key, T &&val, typename value_traits< T >::type *=0)

Function overload

Synopsis

#include <include/cpptoml.h>

void insert(const std::string &key, const std::shared_ptr< base > &value)

Description

Adds an element to the keytable.

Source

Lines 1537-1540 in include/cpptoml.h.

void insert(const std::string& key, const std::shared_ptr<base>& value)
{
    map_[key] = value;
}

Synopsis

#include <include/cpptoml.h>

template <class T>
void insert(const std::string &key, T &&val, typename value_traits< T >::type *=0)

Description

Convenience shorthand for adding a simple element to the keytable.

Source

Lines 1546-1551 in include/cpptoml.h.

template <class T>
void insert(const std::string& key, T&& val,
            typename value_traits<T>::type* = 0)
{
    insert(key, make_value(std::forward<T>(val)));
}





Add Discussion as Guest

Log in