Skip to content

Instantly share code, notes, and snippets.

@4e1e0603
Created December 3, 2015 11:41
Show Gist options
  • Save 4e1e0603/847003f3ad18cd73d2c1 to your computer and use it in GitHub Desktop.
Save 4e1e0603/847003f3ad18cd73d2c1 to your computer and use it in GitHub Desktop.
C++ generic `pair` type example.
///
/// uetoyo
///
template<typename F, typename S>
class Pair
{
public:
inline Pair(F first, S second) : _first(first), _second(second)
{
}
private:
F _first;
S _second;
};
#include <iostream>
#include "pair.hxx"
int main()
{
//Pair<int, int> pair(new int(), new int());
Pair<int, int> pair(1, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment