[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: axis-group-interface: avoid some cast warnings (issue 583510045 by a
From: |
nine . fierce . ballads |
Subject: |
Re: axis-group-interface: avoid some cast warnings (issue 583510045 by address@hidden) |
Date: |
Sun, 16 Feb 2020 05:17:53 -0800 |
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 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.
https://codereview.appspot.com/583510045/