Skip to content

Instantly share code, notes, and snippets.

View sebbekarlsson's full-sized avatar
🐧
Programming

Sebastian Karlsson (ianertson) sebbekarlsson

🐧
Programming
View GitHub Profile
@sebbekarlsson
sebbekarlsson / cpp_multiple_types.cpp
Last active September 18, 2018 07:12
C++ function that returns multiple types and multiple types as argument
#include <iostream>
template <typename T>
T perform_operation(const T& left, std::string op, const T& right) {
if (op == "+")
return left + right;
if (op == "-")
return left - right;
}