https://codereview.appspot.com/583510045/diff/559490043/lily/axis-group-interface.cc File lily/axis-group-interface.cc (right): https://codereview.appspot.com/583510045/diff/559490043/lily/axis-group-interface.cc#newcode277 lily/axis-group-interface.cc:277: Interval_t<vsize> rank_span (rank_span_int[LEFT], rank_span_int[RIGHT]); A constructor would clean this ...
5 years, 2 months ago
(2020-02-16 13:17:53 UTC)
#2
https://codereview.appspot.com/583510045/diff/559490043/lily/axis-group-inter...
File lily/axis-group-interface.cc (right):
https://codereview.appspot.com/583510045/diff/559490043/lily/axis-group-inter...
lily/axis-group-interface.cc:277: Interval_t<vsize> rank_span
(rank_span_int[LEFT], rank_span_int[RIGHT]);
A constructor would clean this up. I tried this:
template <typename T2>
Interval_t (Interval_t<T2> const &src) : Interval_t (src[LEFT], src[RIGHT])
{
}
Having that, both of the following compiled:
Interval_t<vsize> rank_span (g->spanned_rank_interval ());
Interval_t<vsize> rank_span = g->spanned_rank_interval ();
I also tested Interval_t<unsigned char> and the compiler still properly warns
about conversions.
Issue 583510045: axis-group-interface: avoid some cast warnings
(Closed)
Created 5 years, 2 months ago by hanwenn
Modified 5 years, 2 months ago
Reviewers: lemzwerg, Dan Eble
Base URL:
Comments: 1