Skip to content

Instantly share code, notes, and snippets.

@daviddoria
Created December 9, 2015 22:18
Show Gist options
  • Save daviddoria/4ea5d826684993b1e4ef to your computer and use it in GitHub Desktop.
Save daviddoria/4ea5d826684993b1e4ef to your computer and use it in GitHub Desktop.
#include <iostream>
struct Point
{
public:
double x,y,z;
};
// A mixin to add an 'A' value to a point
template<class Base>
class A : public Base
{
public:
template <typename T_RHS>
A& operator=( const T_RHS& rhs )
{
Base::operator=(rhs);
}
double a;
};
int main()
{
Point point;
A<Point> aPoint = point;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment