Skip to content

Instantly share code, notes, and snippets.

@nurettin
Created September 14, 2013 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurettin/6560944 to your computer and use it in GitHub Desktop.
Save nurettin/6560944 to your computer and use it in GitHub Desktop.
C++, because I can.
#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