An ambiguous syntax in fluid/framework/dim.h
Created by: wangkuiyi
In the class template DimGetter
, there are two signatures of impl
:
cpplint complains about the second impl
because its parameter is not a const reference:
dim.h:118: Is this a non-const reference? If so, make const or use a pointer: D& d [runtime/references] [2]
This complaint intrigues us to think of the correct design:
-
The purpose of the first
impl
is to get, whereas the second is for *set, so -
we should move the second
impl
into a new class templateDimSetter
:template <int i> struct DimSetter { HOSTDEVICE static void impl(const D&d, int64_t v) { ...