I'm fine with replacing my version with this. But if we do so, it seems ...
12 years, 4 months ago
(2012-07-27 15:08:45 UTC)
#3
I'm fine with replacing my version with this. But if we do so, it seems like we
should make the IsConst thing stand-alone and not embed it inside the AutoTUnref
class.
LGTM. Since the helper template classes look a bit awkward when they're used I do ...
12 years, 4 months ago
(2012-07-30 12:32:33 UTC)
#6
LGTM.
Since the helper template classes look a bit awkward when they're used I do
wonder if they should be macro wrapped. Something like:
#define SK_IS_CONST(T) (typename SkTIsConst< T >::value) // not sure if
can/should have typename
#define SK_MAKE_CONST(T, CONST) (typename SkTConstType< T, CONST >::type)
// this seems pretty easy to read, if it is correct.
typedef SK_MAKE_CONST(BlockRef<T>, SK_IS_CONST(T)) BlockRefType;
https://codereview.appspot.com/6448066/diff/5001/include/core/SkTemplates.h
File include/core/SkTemplates.h (right):
https://codereview.appspot.com/6448066/diff/5001/include/core/SkTemplates.h#n...
include/core/SkTemplates.h:21: /** SkTIsConst<T>::value is true if the type C is
const. */
Shouldn't it be if "type T is const."?
Issue 6448066: Const correct BlockRef in SkAutoTUnref (alt to 6450054).
(Closed)
Created 12 years, 4 months ago by bungeman
Modified 12 years, 4 months ago
Reviewers: reed1, bsalomon
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 2