Using decltype to get an expression’s type, without the const

I prefer auto i = decltype(e){0}; for this. It’s a bit simpler than using type_traits, and I feel it more explicitly specifies the intent that you want a variable initialized to a 0 of e‘s type.

I’ve been using Herb’s “AAA Style” a lot lately, so it could just be bias on my part.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)