I have a C++ Vector class in my program. It is a templated class which takes `<T, unsigned>`

as its arguments (data type and dimension). I then use `typedefs`

to define the most common types, like so:

```
typedef Vector<bool, 3> Vector3f;
typedef Vector<int, 3> Vector3i;
typedef Vector<float, 3> Vector3f;
typedef Vector<unsigned, 3> Vector3u;
```

All operators except for `[]`

and `=`

are implemented as templated free functions to reduce code duplication. I am trying to expose these classes to ChaiScript. Below is an example of a partial Vector3f hookup to ChaiScript.

```
ModulePtr vec3fClass(new Module());
vec3fClass->add(user_type<Math::Vector3f>(), "Vector3f");
vec3fClass->add(constructor<Math::Vector3f()>(), "Vector3f");
vec3fClass->add(constructor<Math::Vector3f(float)>(), "Vector3f");
vec3fClass->add(constructor<Math::Vector3f(float, float, float)>(), "Vector3f");
vec3fClass->add(constructor<Math::Vector3f(const Math::Vector3f&)>(), "Vector3f");
vec3fClass->add(fun(&Math::Vector3f::data), "data");
vec3fClass->add(fun(&Math::Vector3f::x), "x");
vec3fClass->add(fun(&Math::Vector3f::y), "y");
vec3fClass->add(fun(&Math::Vector3f::z), "z");
vec3fClass->add(fun(&Math::Vector3f::toString), "toString");
vec3fClass->add(fun(&Math::Vector3f::operator=), "=");
vec3fClass->add(fun(&Math::Vector3f::operator[]), "[]");
vec3fClass->add(fun(&Math::operator!<float, 3>), "!");
vec3fClass->add(fun(&Math::operator==<float, 3>), "==");
vec3fClass->add(fun(&Math::operator!=<float, 3>), "!=");
vec3fClass->add(fun(&Math::operator><float, 3>), ">");
vec3fClass->add(fun(&Math::operator>=<float, 3>), ">=");
```

So far so good. But two problems arise when I try to add the rest of the operators.

##1. Overloaded and templated operators

I am running into issues when binding operators that have multiple versions of them. Take `operator+`

for example:

```
// Promote all vector components (make positive)
template <typename T, unsigned n>
Vector<T, n> operator +(const Vector<T, n>& right);
// Add two vectors of the same type
template <typename T, unsigned n>
Vector<T, n> operator +(const Vector<T, n>& left, const Vector<T, n>& right);
// Add a vector and a scalar (same type)
template <typename T, unsigned n>
Vector<T, n> operator +(const Vector<T, n>& vector, const T& scalar);
// Add a scalar and a vector (same type)
template <typename T, unsigned n>
Vector<T, n> operator +(const T& scalar, const Vector<T, n>& vector);
```

As you can see, `operator+`

is a heavily overloaded function. So when I try to do this:

```
vec3fClass->add(fun(&Math::operator+<float, 3>), "+");
```

I get the following error:

```
error: no matching function for call to 'fun(<unresolved overloaded function type>)'
vec3fClass->add(fun(&Math::operator+<float, 3>), "+");
^
```

Is there a way to specify each specific permutation of `operator+`

that exists for `Vector<float, 3>`

(aka `Vector3f`

)?

##2. Specific issue with `operator<`

and `operator<=`

This has less to do with ChaiScript library itself and more to do with the function binding process. Both `operator<`

and `operator<=`

are not overloaded functions. The real problem with them is a simple but ultimately frustrating one. When I try to do something like this:

```
vec3fClass->add(fun(&Math::operator<<float, 3>), ">=");
vec3fClass->add(fun(&Math::operator<=<float, 3>), ">=");
```

the compiler mistakes `operator<<`

as an actual operator and dumps the following compilation error:

```
error: 'operator<<' is not a member of 'Math'
vec3fClass->add(fun(&Math::operator<<float, 3>), "<");
^
```

Shame that `<`

operator and the beginning of a template argument share the same character. Is there a way to work around this?

Sorry for the large wall of text. Thanks in advance for the help.