mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-12 12:25:21 +08:00
13 lines
503 B
C++
13 lines
503 B
C++
#include <drogon/HttpViewData.h>
|
|
#include <iostream>
|
|
int main()
|
|
{
|
|
drogon::HttpViewData data;
|
|
std::cout << (data.insert("1", 1), data.get<int>("1")) << std::endl;
|
|
std::cout << (data.insertAsString("2", 2.0), data.get<std::string>("2")) << std::endl;
|
|
std::cout << (data.insertFormattedString("3", "third value is %d", 3),
|
|
data.get<std::string>("3"))
|
|
<< std::endl;
|
|
std::cout << (data.insertAsString("4", "4"), data.get<std::string>("4")) << std::endl;
|
|
}
|