Jump to page: 1 2
Thread overview
hello all
Aug 12, 2003
lattice
Aug 12, 2003
Greg Peet
Aug 12, 2003
Matthew Wilson
Aug 12, 2003
Greg Peet
Aug 12, 2003
Jan Knepper
Aug 12, 2003
Matthew Wilson
Aug 12, 2003
Jan Knepper
Aug 12, 2003
Matthew Wilson
Aug 13, 2003
Jan Knepper
Dec 12, 2003
Luc Hermitte
Oct 17, 2003
John Abney
Aug 12, 2003
Matthew Wilson
August 12, 2003
I am a fan of STL and a new user to STLSoft.


August 12, 2003
"lattice" <zhangwusheng@sina.com> wrote in message
news:bh9qtg$2uj4$1@digitaldaemon.com...
| I am a fan of STL and a new user to STLSoft.

Hello there!

Yes I agree! The Standard Template Library is awesome. When I first learned the use of templates I was shocked that I did not have to write countless overloaded functions. Quite nice isn't it?

There are numerous sites you should know about for your STLSoft escapades.

The Faq site: http://stlsoft.gregpeet.com (Oops is this first? =P)
The Main site: http://www.stlsoft.org
The Digital Mars site: http://www.digitalmars.com/~stlsoft

Please feel free to post comments, questions, requests to this newsgroup (or privately, if you wish, to me and Matt via the Faq site's contact page).

Happy hacking and hope to see you posting =)
-- 

Regards,
Gregory Peet

Fellow Digital Martian
STLSoft FAQ: http://stlsoft.gregpeet.com


August 12, 2003
Welcome.

Feel free to post your STLSoft comments, bug reports (not that there'll be many of them ...) and requests here.

Cheers


--
--
Matthew Wilson

STLSoft moderator and C++ monomaniac

mailto:matthew@stlsoft.org
http://www.stlsoft.org
news://news.digitalmars.com/c++.stlsoft

"So far, C++ is the best language I've discovered to say what I want to say" -- Alex Stepanov

----------------------------------------------------------------------------


"lattice" <zhangwusheng@sina.com> wrote in message news:bh9qtg$2uj4$1@digitaldaemon.com...
> I am a fan of STL and a new user to STLSoft.
>
>


August 12, 2003
> Yes I agree! The Standard Template Library is awesome. When I first
learned
> the use of templates I was shocked that I did not have to write countless overloaded functions. Quite nice isn't it?

I first thought it was awful. Those were the days when I thought OO and inheritance were profound things, so ...

> There are numerous sites you should know about for your STLSoft escapades.
>
> The Faq site: http://stlsoft.gregpeet.com (Oops is this first? =P)
> The Main site: http://www.stlsoft.org
> The Digital Mars site: http://www.digitalmars.com/~stlsoft

I like it how you've put the gregpeet.com address up first. Power to your ego!

> Please feel free to post comments, questions, requests to this newsgroup
(or
> privately, if you wish, to me and Matt via the Faq site's contact page).

I'd *much* prefer comments to be on the newsgroup, than sent in private. I'm not troubled by bug reports - in fact I encourage them - and as yet have received no criticisms in any forum, so am not worried about that either.

Post away!


--
--
Matthew Wilson

STLSoft moderator and C++ monomaniac

mailto:matthew@stlsoft.org
http://www.stlsoft.org
news://news.digitalmars.com/c++.stlsoft

"I can't sleep nights till I found out who hurled what ball through what apparatus" -- Dr Niles Crane



August 12, 2003
"Matthew Wilson" <matthew@stlsoft.org> wrote in message
news:bha51n$913$1@digitaldaemon.com...
| I like it how you've put the gregpeet.com address up first. Power to your
| ego!

I'm not sure what you're talking about =P


August 12, 2003
> I first thought it was awful. Those were the days when I thought OO and inheritance were profound things, so ...

Actually... I *still* think OO is great.

STL only uses half the power of C++. If the original design was done a little
better they could have done it in such a way that STL could be used two fold:
1.    Derived from an empy base class which would be optimized out with the
compiler and STL would be STL as is.
2.    Derived from a common (replaceable) base class and STL could have been
STL, but with OO and all the OO power of C++.

Something like:


class  empty_iterator
{
};

class  empty_collection
{
public    :
    typedef empty_iterator        iterator_base;
};

class  common_iterator
{
public    :
    virtual ...
};

class  common_collection
{
public    :
    typedef common_iterator     iterator_base;

public    :
    virtual common_iterator        begin ();
    virtual common_iterator        end   ();
};


template < class X, class Base = empty_collection > vector : public Base
{
public    :
    template < class X, class IBase > _iterator : public  IBase
    {
        //
    }

    typedef _Iterator < X, Base :: iterator_base >        iterator;

public    :
    // Would be virtual when vector < Type, common_collection > is used.
    // Would NOT be virtual per default: vector < Type, empty_collection>
    iterator                                begin    ();
    iterator                                end      ();

    // etc...
};

Of course this would require the iterator interface to be standardized so that there always is a 'first' and 'second' member which in case of a vector, set, etc could both point to the key and key is data...

Better, we would be able to 'replace' the base of any STL template collection when a custom class would be derived from common_collection as:

class  MyCollection : public  common_collection
{
};

class  MyVector : public vector < int, MyCollection >
{
};

Now my personal opinion is that this TRUELY would have been great.

Jan



--
ManiaC++
Jan Knepper


August 12, 2003
"Jan Knepper" <jan@smartsoft.us> wrote in message news:3F39093B.5D8A84CD@smartsoft.us...
> > I first thought it was awful. Those were the days when I thought OO and inheritance were profound things, so ...
>
> Actually... I *still* think OO is great.

I guess I do, in a way. I was probably just being sly for a good quote. <blush>

> STL only uses half the power of C++. If the original design was done a
little
> better they could have done it in such a way that STL could be used two
fold:
> 1.    Derived from an empy base class which would be optimized out with
the
> compiler and STL would be STL as is.
> 2.    Derived from a common (replaceable) base class and STL could have
been
> STL, but with OO and all the OO power of C++.
>

  . . .

<snip>

Nice.

Actually, I'll be sending you some docs soon demonstrating a very similar technique, albeit for a quite different class. Now you've got me thinking ... maybe we'll see some more (borrowed) flesh on the concept in the next revision, correctly attributed of course. ;)

btw, isn't this a potentially rather spiffy thought to carry into the DTL.

Yours impressedly

Peter the Plagiarist


-- 
Matthew Wilson

STLSoft moderator and C++ monomaniac

mailto:matthew@stlsoft.org
http://www.stlsoft.org
news://news.digitalmars.com/c++.stlsoft

"If i'm curt with you it's because time is a factor. I think fast, I talk fast, and I need you guys to act fast" -- Mr Wolf

----------------------------------------------------------------------------
---



August 12, 2003
Matthew Wilson wrote:

> "Jan Knepper" <jan@smartsoft.us> wrote in message news:3F39093B.5D8A84CD@smartsoft.us...
> > > I first thought it was awful. Those were the days when I thought OO and inheritance were profound things, so ...
> >
> > Actually... I *still* think OO is great.
>
> I guess I do, in a way. I was probably just being sly for a good quote. <blush>

<g> Don't worry about it...

> > STL only uses half the power of C++. If the original design was done a
> little
> > better they could have done it in such a way that STL could be used two
> fold:
> > 1.    Derived from an empy base class which would be optimized out with
> the
> > compiler and STL would be STL as is.
> > 2.    Derived from a common (replaceable) base class and STL could have
> been
> > STL, but with OO and all the OO power of C++.
> >
>
>   . . .
>
> <snip>
>
> Nice.

Thanks!
It is an <brag> original idea </brag>, but I heard later that someone else
(might have been Scott Meyers) wrote something alike about it.

> Actually, I'll be sending you some docs soon demonstrating a very similar technique, albeit for a quite different class. Now you've got me thinking ... maybe we'll see some more (borrowed) flesh on the concept in the next revision, correctly attributed of course. ;)

I just smacked the example out rather quickly. The syntax might have been a bit
off.
Because *some* people are so much into templates and STL and forget that the
real power of C++ started with OO I got so upset a while ago that I started
http://www.vstl.org/ ;-)
I made a start patching a SGI version of STL to actually create VSTL, but I am
kinda short in time and money at the moment...

> btw, isn't this a potentially rather spiffy thought to carry into the DTL.

Now, that would be a GREAT idea. Let's not make the same mistake twice, but
honer design patterns... ;-) Well, that last one because I am upset with the
ANSI committee for prototyping swprintf as snwprintf. They didn't want to make
the same mistake twice either, but I think declined the fact that there is tons
of code out there that works with swprintf WITHOUT the string length parameters.
Besides, they had a nice pattern going as:
printf -> wprintf
sprintf -> swprintf
snprintf -> snwprintf
vsprintf -> vswprintf
vsnprintf -> vsnwprintf
Which is now broke... <sigh>

> Yours impressedly

Now now... ;-)

> Peter the Plagiarist

Who does not?

--
ManiaC++
Jan Knepper



August 12, 2003
> It is an <brag> original idea </brag>,

Being such a software solipsist, I can assure you my idea was original as well. <g> Alas, so many people having the same ideas. sigh ...

> I just smacked the example out rather quickly. The syntax might have been
a bit off.
>
> Because *some* people are so much into templates and STL and forget that
the real power of C++ started with OO I got so upset a while ago that I started http://www.vstl.org/ ;-)

Curse those types. I can't stand people like that ...

Actually, I do kind of agree with your sentiments. It is certainly something worth pursuining at some point in the future.

> I made a start patching a SGI version of STL to actually create VSTL, but
I am kinda short in time and money at the moment...

Am absolutely with you there, my penurious brother. When oh when will it start to rain again ...

> Now, that would be a GREAT idea. Let's not make the same mistake twice,
but honer design patterns... ;-)

Sounds cool. I've a massive list of stuff to go into STLSoft 1.7.1, but it's going to be awhile. There are a couple of container ideas, and maybe we can chat about them before it goes in, and perhaps enable some VSTL stuff? (Current timeline: 4 chapters to you guys tomorrow; CUJ column by the 18th; STLSoft 1.6.5 next week; more chapters for book for foreseeable future; never-ending writing commitments having me superglued into my chair and not seeing the world or going for nice bike rides; ... ; STLSoft 1.7.1; ...; Borland, Intel, Metrowerks, Microsoft, Sun form a consortium to invest in STLSoft and make me very rich; ... wake up from delusions to find I'm back at the beginning of the book; ...; remainder of my days blurbling around a padded room;)

To be serious, have you checked out my Veneers concept (http://synesis.com.au/resources/articles/cpp/veneers.pdf), as this has some related stipulations about in what ways (non-polymorphic, i.e. non-vtable) inheritance can be done?

> Well, that last one because I am upset with the ANSI committee for
prototyping swprintf as snwprintf. They didn't want to make the same mistake twice either, but I think declined the fact that there is tons of code out there that works with swprintf WITHOUT the string length parameters. Besides, they had a nice pattern going as:
> printf -> wprintf
> sprintf -> swprintf
> snprintf -> snwprintf
> vsprintf -> vswprintf
> vsnprintf -> vsnwprintf
> Which is now broke... <sigh>

Agreed.


August 13, 2003
> > It is an <brag> original idea </brag>,
>
> Being such a software solipsist, I can assure you my idea was original as well. <g> Alas, so many people having the same ideas. sigh ...
>
> > I just smacked the example out rather quickly. The syntax might have been
> a bit off.
> >
> > Because *some* people are so much into templates and STL and forget that
> the real power of C++ started with OO I got so upset a while ago that I started http://www.vstl.org/ ;-)
>
> Curse those types. I can't stand people like that ...

Thanks!

> Actually, I do kind of agree with your sentiments. It is certainly something worth pursuining at some point in the future.

Cool!

> > I made a start patching a SGI version of STL to actually create VSTL, but
> I am kinda short in time and money at the moment...
>
> Am absolutely with you there, my penurious brother. When oh when will it start to rain again ...

Oh, it rains here and than it gets warm... and sticky...

> > Now, that would be a GREAT idea. Let's not make the same mistake twice,
> but honer design patterns... ;-)
>
> Sounds cool. I've a massive list of stuff to go into STLSoft 1.7.1, but it's going to be awhile. There are a couple of container ideas, and maybe we can chat about them before it goes in, and perhaps enable some VSTL stuff? (Current timeline: 4 chapters to you guys tomorrow; CUJ column by the 18th; STLSoft 1.6.5 next week; more chapters for book for foreseeable future; never-ending writing commitments having me superglued into my chair and not seeing the world or going for nice bike rides; ... ; STLSoft 1.7.1; ...; Borland, Intel, Metrowerks, Microsoft, Sun form a consortium to invest in STLSoft and make me very rich; ... wake up from delusions to find I'm back at the beginning of the book; ...; remainder of my days blurbling around a padded room;)

;-)

> To be serious, have you checked out my Veneers concept (http://synesis.com.au/resources/articles/cpp/veneers.pdf), as this has some related stipulations about in what ways (non-polymorphic, i.e. non-vtable) inheritance can be done?

Actually, I had not looked at it before, but I have used constructions like (not
exactly like) this in the past one was for more or less the same reason as you
explained to make MFC controls 'cool' or 'hover over' sensitive without deriving
separately from each control. Instead I had a template like:
tempate < class  Ctrl > CoolCtrl : public  Ctrl
{
   // etc...
};

Than...

typedef CoolCtrl < CEdit >            CoolEditCtrl;
typedef CoolCtrl < CDateTimeCtrl >    CoolDateTimeCtrl;

etc..

Since I am writing some C++ code for the Symbian ( http://www.symbian.com/ http://www.nokia.com/ ) operating system at this moment and had to implement the same extension functionality for two different classes at some point derived from the same base class I used the same type of construction again... Just a template to extend each of the classes and typedef'ed them... ;-)

> > Well, that last one because I am upset with the ANSI committee for
> prototyping swprintf as snwprintf. They didn't want to make the same mistake twice either, but I think declined the fact that there is tons of code out there that works with swprintf WITHOUT the string length parameters. Besides, they had a nice pattern going as:
> > printf -> wprintf
> > sprintf -> swprintf
> > snprintf -> snwprintf
> > vsprintf -> vswprintf
> > vsnprintf -> vsnwprintf
> > Which is now broke... <sigh>
>
> Agreed.

Thanks!

--
ManiaC++
Jan Knepper



« First   ‹ Prev
1 2