Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

Handling a friend operator

Last post 08-11-2008, 1:53 PM by n00body. 0 replies.
Sort Posts: Previous Next
  •  08-11-2008, 1:53 PM 2689

    Handling a friend operator

    My situation is that I'm trying to bind my Vector3 C++ class, using SqPlus, and I've hit a snag with an operator defined as a friend.

    Specifically, I'm trying to define an operator* so that I can multiply the Vector3 by a float on the left side (ex. "2.0 * myVec"). Using member operators, I can only do "myVec * 2.0".

    Is there any way to achieve this behavior in Squirrel, or am I stuck with multiplying on the right?

    -~ Amateur game dev ~-
    Current goal: Find best way to write my math library
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems