/* * * * Copyright (c) 2015, Greg Landrum * All rights reserved. * * This file is part of the RDKit. * The contents are covered by the terms of the BSD license * which is included in the file license.txt, found at the root * of the RDKit source tree. * * taken from this stackexchange answer: http://stackoverflow.com/a/12768318 */ %{ #include %} namespace boost { template struct tuple; template <> struct tuple { }; template struct tuple { tuple(T1); %extend { T1 first() const { return boost::get<0>(*$self); } } }; template struct tuple { tuple(T1,T2); %extend { T1 first() const { return boost::get<0>(*$self); } T2 second() const { return boost::get<1>(*$self); } } }; template struct tuple { tuple(T1,T2,T3); %extend { T1 first() const { return boost::get<0>(*$self); } T2 second() const { return boost::get<1>(*$self); } T3 third() const { return boost::get<2>(*$self); } } }; }