vec_common is required as some definitions are needed by
both vectorwrapper and vec_base. I also wanted to keep
all of the define_has_* macro invocations together, for
clarity.
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>.
Multiple versions of the same library can't be used in the same
project because even tho project take care to include from
the right vectorwrapper-1.0/ dir the inclusion guard is the
same. So in spite of having a different path and livingi in a
different namespace, ifndef is preventing the inclusions to work.
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.
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.
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.
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.