Skip to content

Instantly share code, notes, and snippets.

@alexpearce
Created January 20, 2014 10:30
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 alexpearce/8517971 to your computer and use it in GitHub Desktop.
Save alexpearce/8517971 to your computer and use it in GitHub Desktop.
This is an example C++ class using C++11 features and ROOT.
#include "iostream"
#include "map"
#include "TString.h"
int main(int argc, char const *argv[])
{
std::map<int, TString>myMap {
{2, "Hello"},
{4, "There"},
{8, "Stranger"},
};
for (auto& kv: myMap) {
std::cout << kv.first << ": " << kv.second << std::endl;
}
return 0;
}
@alexpearce
Copy link
Author

To compile, do

$ clang++ -std=c++11 -Wall `root-config --libs` `root-config --cflags` test.cpp -o test; ./test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment