Commit Graph

39 Commits

Author SHA1 Message Date
King_DuckZ 9d63269bfa Remove gtest copy
I don't know why this was included not as a
submodule or a regular dependency, but it looks
wrong to me. Re-added as submodule.
2021-04-06 12:15:24 +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 cdb2650241 Just some test for wrappers of c-style arrays 2021-03-12 00:11:28 +01:00
King_DuckZ 222a3b3621 Update copyright to 2020 2020-05-04 03:59:02 +02:00
King_DuckZ 4f47a24478 Add min/max functions 2020-05-04 03:54:15 +02:00
King_DuckZ 2e30692071 Fix cmake files so client projects can link to the interface target.
This way they can link to vwr::vectorwrapper to have the
correct include path added.
2020-04-07 23:53:19 +02:00
King_DuckZ 0a90a289a2 Add support for meson build system. 2020-03-28 21:02:28 +01:00
King_DuckZ 19b12600d8 Add the version number to vectorwrapper.hpp 2019-01-19 11:06:49 +00:00
King_DuckZ a4184811b1 Add test for a custom type.
Custom type is implicitly constructible, implicitly castable
to float and can be compared to int.
2018-10-30 20:31:49 +00:00
King_DuckZ 1e713696d7 Add unit test for offset-based getters. 2018-07-28 00:04:24 +01:00
King_DuckZ d9dacb739a Properly stop looping when vec values go past the end. 2017-08-02 23:37:25 +01:00
King_DuckZ e242f0b154 Allow an iteration step. 2017-07-27 20:48:52 +01:00
King_DuckZ c1b6bd0500 Add unit test for backwards iteration. 2017-07-26 22:48:39 +01:00
King_DuckZ 221f236f40 Finish implementing the sequence_range feature. 2017-07-26 21:16:19 +01:00
King_DuckZ 0e739c9582 Broken implementation of vector_iterator. WiP 2017-07-26 13:52:30 +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 aaa8e75dc1 Implement 2D and 3D cross product.
2D cross product is defined as equivalent to:
res = cross(a.xy0(), b.xy0()).z()
2017-02-01 01:51:52 +00:00
King_DuckZ fc7b666429 Add optional methods like yx(), x1(), x0() etc...
You need to define VWR_EXTRA_ACCESSORS if you want those
to be available in your build.
2017-01-27 19:24:27 +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 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 891fa25675 Add vector_cast implementation and the unit test for it. 2016-11-02 01:19:48 +01:00
King_DuckZ dc1b3e7b76 Use ctest in cmake. 2016-11-02 01:19:48 +01:00
King_DuckZ 6ab4d586eb Disable implicit conversions by default and update readme.
Implicit conversions are still needed for the old unit test to build.
2016-11-02 01:12:00 +01:00
King_DuckZ 736e83893a Add test for wrapped vector using get_at() which was not working previously. 2016-10-25 01:18:44 +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 958de67849 Make scalar_type and vector_type public in Vec.
- Add a dot product implementation.
- Test code to demonstrate dot product.
- Test code to demonstrate wrapping structs with unordered properties.
2015-07-25 19:41:16 +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 b7c7d77dac New test program based on gtest. 2015-07-23 23:10:03 +02:00
King_DuckZ 987cdd66ef Import gtest 1.7.0 2015-07-23 23:08:41 +02:00