[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Overview, Sept. 2014
From: |
Steffen Nurpmeso |
Subject: |
Re: [Groff] Overview, Sept. 2014 |
Date: |
Thu, 11 Sep 2014 13:09:19 +0200 |
User-agent: |
s-nail v14.7.6-15-gc1887ab |
Ulrich Lauther <address@hidden> wrote:
|That templates are not used is a GOOD THING.
I disagree with you, templates are a fantastic thing for
typesafety. The problem i have with STL is the massive code blow.
I instead used all-inline template wrappers of void* based generic
collection types; to be able to manage object there were
template-based type traits and toolboxes, as in (less docu)
template<class T, boolean OWNS=TypeTraits<T>::ownguess>
class Vector
:
private GVector
{
pub typedef CollTraits<Super,T,T> CTraits;
pub typedef TypeTraits<T> TTraits;
pub typedef typename TTraits::Toolbox TToolbox;
pub typedef typename TTraits::AutoToolbox TAutoToolbox;
If you wanted the collection to OWN the object (instances had to
be owned, of course, pointers not necessarily) then there was
a need for a toolbox, as in
auto List<CString> sl1(CString::toolbox)
auto List<CString*,tru1> sl2(CString::toolbox);
Most types had one already, but the AutoToolbox template could
also be used instead (if the object supported some basic
functions, e.g. compare()). Note this scheme couldn't handle
pointer-to-pointer based Ts, but which really didn't matter. It
was lean, fast and easy to use.
--steffen
- Re: [Groff] Overview, Sept. 2014, (continued)
- Re: [Groff] Overview, Sept. 2014, Ralph Corderoy, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Steffen Nurpmeso, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Werner LEMBERG, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Steffen Nurpmeso, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Ulrich Lauther, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Werner LEMBERG, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Ulrich Lauther, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, lxnf98mm, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Werner LEMBERG, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Ulrich Lauther, 2014/09/10
- Re: [Groff] Overview, Sept. 2014,
Steffen Nurpmeso <=
- Re: [Groff] Overview, Sept. 2014, Ralph Corderoy, 2014/09/11
- Re: [Groff] Overview, Sept. 2014, Steffen Nurpmeso, 2014/09/11
- Re: [Groff] Overview, Sept. 2014, Steffen Nurpmeso, 2014/09/11
- Re: [Groff] Overview, Sept. 2014, Ralph Corderoy, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Ulrich Lauther, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Werner LEMBERG, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Ingo Schwarze, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Ulrich Lauther, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Peter Schaffter, 2014/09/10
- Re: [Groff] Overview, Sept. 2014, Steffen Nurpmeso, 2014/09/11