Skip to content

Instantly share code, notes, and snippets.

@motonacciu
Created July 26, 2012 15:56
Show Gist options
  • Select an option

  • Save motonacciu/3182883 to your computer and use it in GitHub Desktop.

Select an option

Save motonacciu/3182883 to your computer and use it in GitHub Desktop.
// Termination case (A, B) -> std::pair<A,B>
template <typename LhsTy, typename RhsTy>
std::pair<LhsTy,RhsTy> makeTree(const LhsTy& lhs, const RhsTy& rhs) {
return {lhs, rhs};
}
template <typename Arg1, typename Arg2, typename Arg3, typename... Args>
auto makeTree(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Args&... args) -> ???
{
return {arg1, makeTree(arg2,arg3,args...)};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment