Function insertAsString

Synopsis

#include <lib/inc/drogon/HttpViewData.h>

template <typename T>
void insertAsString(const std::string &key, T &&val)

Description

Insert an item identified by the key parameter into the data set; The item is converted to a string.

Source

Lines 67-73 in lib/inc/drogon/HttpViewData.h.

template <typename T>
void insertAsString(const std::string &key, T &&val)
{
    std::stringstream ss;
    ss << val;
    viewData_[key] = ss.str();
}


Discussions (1)

behnamsabaghi 4 months ago 1

Is there a way to convert Json::Value to HttpViewData ?




Add Discussion as Guest

Log in