Commit Graph

30 Commits

Author SHA1 Message Date
King_DuckZ fcaa62d69f Fix copy-construction warning in clang
This bumps the c++ requirement to c++17
2021-04-08 15:01:42 +02:00
King_DuckZ 7d5d4c2e05 Fix assignment when wrapped type is a c-style array 2021-03-18 16:07:49 +01:00
King_DuckZ 222a3b3621 Update copyright to 2020 2020-05-04 03:59:02 +02:00
King_DuckZ a81c4c1077 Add support for 4D vectors. 2018-07-27 23:41:23 +01:00
King_DuckZ 08378698b8 Move VecBase stuff to its own .inl file. 2018-07-27 23:22:21 +01:00
King_DuckZ 421e5e2433 Allow extra casting if users explicitly whitelist them.
They'll have to make VectorTypeInfo<V> inherit from
is_castable_to<U> for every U they want the V to be
castable to. Note that if they also want U to be castable
to V (so the other way around) they'll have to explicitly
whitelist that conversion too in VectorTypeInfo<U>.
2017-07-27 23:42:21 +01:00
King_DuckZ 6ce534fc8a Update license header 2017-03-15 22:13:13 +00:00
King_DuckZ 83418105e3 static_cast assignments by default.
This can be disabled by defining VWR_WITH_UNCASTED_ASSIGNMENT.
2017-03-11 08:45:11 +00:00
King_DuckZ db7b9becd5 Let users specify a wrapping namespace.
This is useful when vwr is used and publicly exposed in a
library. If both the library and the standalone project depend
on vwr, this change gives the user the opportunity to keep the
two usages separate. This is especially important if both the
library and the standalone program happen to specialize the
Info template for the same type.
2017-03-04 00:04:40 +00:00
King_DuckZ 69e342460c Implement binary assignment operators for scalar types. 2017-01-27 19:07:15 +00:00
King_DuckZ 48d7b5ddec Replace implementation of binary op assignments.
Use variadic templates instead of for loops. Add unit test.
2017-01-27 19:02:52 +00:00
King_DuckZ bbaabb695d Implement operators with scalar types. 2017-01-27 18:43:21 +00:00
King_DuckZ 780e6647b2 Implement unary operator- 2017-01-26 17:28:17 +00:00
King_DuckZ 2f4d319675 Implement binary operators.
This also has the benefical side effect of ridding me of that
stupid VWR_STATIC_CAST_RESULTS macro.
2016-11-08 02:24:21 +01:00
King_DuckZ 6bf3278631 Implement comparison operators correctly.
With tests.
2016-11-08 01:51:17 +01:00
King_DuckZ 00470290fe Change hardcoded std::size_t into size_type so it can be customised.
Define VWR_SIZE_TYPE to the type you want to use as the template
index type. It defaults to std::size_t so if you don't do anything
you still get the old behaviour.

Also drop the std::index_range in vector_cast in favour of the custom
bt::number_range, which is already used elsewhere in the code.
2016-11-02 03:53:22 +01:00
King_DuckZ 8af1a36baa Warning fix on clang 2016-11-02 02:45:16 +01:00
King_DuckZ d9ac0531b3 Fix warning about unused typedef. 2016-11-02 01:31:48 +01:00
King_DuckZ f51c739a48 Add a macro to control if the result of binary operators should be casted.
It allows to suppress warnings when combining vectors of a type that
gets promoted to int after the binary operator is applied, for example.
2016-11-02 01:14:23 +01:00
King_DuckZ 2725d4f63d Update copyright to 2016
I think vectorops was missing the copyright header /on purpose/ but
I've added it there as well now.
2016-11-01 22:58:23 +01:00
King_DuckZ 84203ee817 Fix broken build when using the get_at() way wrapper. 2016-10-25 01:07:28 +02:00
King_DuckZ 41eed2c8ba Warning fix 2016-09-05 21:30:17 +02:00
King_DuckZ 7affd7960f Allow casting to vectors of lower dimensions. 2015-07-25 21:18:45 +02:00
King_DuckZ fe03f45f76 Add an example.cpp unit test to demonstrate usage.
Shows what it looks like when you mix vectors of different
type vs using vectorwrapper.
2015-07-25 20:55:52 +02:00
King_DuckZ 1567feaa81 Fix casting.
Casting conditions got clarified.
User is now able to say he doesn't care if casting a wrapper on a
type larger than just the coordinates will stomp on extra data
from the casted type.
2015-07-25 19:12:21 +02:00
King_DuckZ e64db02ac3 Fix cast<> method.
Add vector_type to is_vec, because vector_type is private
and it couldn't be used in cast. Besides if not is_vec, you can't
expect to find vector_type. The conditional in the cast return type
works like if V2 is not a Vec, you can just use V as the vector_type,
anyways the first is_vec is false so the whole condition is going to
be false anyways, even if it results that V == V.
2015-07-25 01:52:27 +02:00
King_DuckZ 30371adba9 Add Vec1Promotion. 2015-07-25 00:55:57 +02:00
King_DuckZ d3b63aab8c Fix some build errors in certain cases.
- wrapped vector is not guaranteed to have constructors
- vector_type is not necessary
- has typedef and has enum were not always working
2015-07-25 00:55:03 +02:00
King_DuckZ 7547450913 Fix build errors and typos in the documentation. 2015-07-23 23:10:55 +02:00
King_DuckZ 08050e42da First import 2015-07-23 01:37:35 +02:00