Created
September 14, 2013 10:42
-
-
Save nurettin/6560944 to your computer and use it in GitHub Desktop.
C++, because I can.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
#include <boost/any.hpp> | |
#include <curl/curl.h> | |
typedef std::map<std::string, boost::any> params_t; | |
void open(params_t params) | |
{ | |
if(boost::any_cast<bool>(params["session"])) | |
std::cout<< "session started!"; | |
curl_easy_cleanup(boost::any_cast<CURL*>(params["curl"])); | |
} | |
int main() | |
{ | |
open({{ "curl", curl_easy_init() }, { "session", true }}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment