Blog series to teach and show off D's metaprogramming by creating a JSON serialiser
SealabJaster
sealabjaster at gmail.com
Fri Nov 1 21:14:56 UTC 2019
On Friday, 1 November 2019 at 11:29:11 UTC, Ethan wrote:
> You also want to catch const(char)[] and just plain char[] for
> JSON serialisation purposes. So a template constraint that
> catches all those is what you want instead of just is( T ==
> string ).
I was definitely thinking of putting that in the first post, but
thought it'd be better to leave it for later. Someone newer to D
might not realise that a string is just a normal array/slice,
instead of a special type (like in C++), so I didn't want to have
to explain that yet.
I'd also need to explain the differences between const and
immutable briefly.
I'm planning on going over it though in a post that goes over
serialising arrays, which will likely be either the 4th or 5th
one.
Though, there's always the possiblity I'm just worrying and
overthinking too much about putting too much into each post. I'm
trying to make things easy to digest, and since I'm not used to
writing things like this, I don't have a great grasp on how a
person newer to D would be able to follow it.
More information about the Digitalmars-d-announce
mailing list