Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more vector types #2

Open
LeviTaule opened this issue Mar 8, 2016 · 0 comments
Open

Allow more vector types #2

LeviTaule opened this issue Mar 8, 2016 · 0 comments
Assignees
Milestone

Comments

@LeviTaule
Copy link
Owner

Using Boost.Geometry strategy, as described in Nexus' post.

Example:

namespace lib
{

// user can specialize this class to support other types
template <typename T>
struct vector_type
{
    static auto x(const T& v) { return v.x; }
    static auto y(const T& v) { return v.y; }
};

// convenience inside library, can also be in private namespace
template <typename T>
auto x(const T& v)
{
    return vector_type<T>::x(v);
}

}
@LeviTaule LeviTaule self-assigned this Mar 8, 2016
@LeviTaule LeviTaule added this to the 0.3.x milestone Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant