Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Standard C++ Library (http://www.velocityreviews.com/forums/t603818-standard-c-library.html)

June Lee 04-02-2008 12:49 AM

Standard C++ Library
 
is it true that Standard C++ Library is pretty much include functions
similar to the following java packages???

java.io
java.lang
java.util

http://www.cplusplus.com/reference/

It seem to me the Standard C++ Library have headers to mainipulate
string / characters, doing I/O, and data structure like Stack, Queue,
HashMap, Vector, time, bitwise operation, exception, iterator on a
collection ... etc

which pretty similar to above "very core" java package

lbonafide@yahoo.com 04-02-2008 01:00 AM

Re: Standard C++ Library
 
On Apr 1, 7:49 pm, June Lee <iiu...@yahoo.com> wrote:
> is it true that Standard C++ Library is pretty much include functions
> similar to the following java packages???
>
> java.io
> java.lang
> java.util
>
> http://www.cplusplus.com/reference/
>
> It seem to me the Standard C++ Library have headers to mainipulate
> string / characters, doing I/O, and data structure like Stack, Queue,
> HashMap, Vector, time, bitwise operation, exception, iterator on a
> collection ... etc
>
> which pretty similar to above "very core" java package


Yes, C++ is a very portable general purpose language that runs on
platforms ranging from super computers to embedded devices. Many of
these platforms and applications which run on them do not require
everything all the time, so it doesn't make sense to stuff GUI,
networking, threading, etc. all into the standard library.

June Lee 04-02-2008 01:15 AM

Re: Standard C++ Library
 
So there are 3 types of library / header in C++?

CRT (C runtime library)
Standard C++ Library
Platform SDK for Visual C++

where CRT is low level code like doing all the bit and bytes
where Platform SDK is high level code doing all those Web Service,
Security, Message Queue, UI / GUI, COM, HTTP / networking stuff?

any other must have / used alot kind of library for C++ that
programmer use alot besides the above 3 library?

>Yes, C++ is a very portable general purpose language that runs on
>platforms ranging from super computers to embedded devices. Many of
>these platforms and applications which run on them do not require
>everything all the time, so it doesn't make sense to stuff GUI,
>networking, threading, etc. all into the standard library.


Ian Collins 04-02-2008 01:20 AM

Re: Standard C++ Library
 
June Lee wrote:

[Please don't top-post]

>
> where CRT is low level code like doing all the bit and bytes
> where Platform SDK is high level code doing all those Web Service,
> Security, Message Queue, UI / GUI, COM, HTTP / networking stuff?
>
> any other must have / used alot kind of library for C++ that
> programmer use alot besides the above 3 library?
>
>> Yes, C++ is a very portable general purpose language that runs on
>> platforms ranging from super computers to embedded devices. Many of
>> these platforms and applications which run on them do not require
>> everything all the time, so it doesn't make sense to stuff GUI,
>> networking, threading, etc. all into the standard library.


> So there are 3 types of library / header in C++?
>
> CRT (C runtime library)
> Standard C++ Library
> Platform SDK for Visual C++


No, there's the C++ standard library, which includes the C standard library.

Anything else is platform specific.

There are several cross-platform libraries that are in widespread use,
boot being one.

--
Ian Collins.

Razii 04-02-2008 03:25 AM

Re: Standard C++ Library
 
On Tue, 01 Apr 2008 17:49:24 -0700, June Lee <iiuu66@yahoo.com> wrote:

>It seem to me the Standard C++ Library have headers to mainipulate
>string / characters, doing I/O, and data structure like Stack, Queue,
>HashMap, Vector, time, bitwise operation, exception, iterator on a
>collection ... etc


Where is this HashMap container in the Standard C++ Library? Poor "Bo
Persson" can't find it. Something he needs to speed up the word
counting benchmark, which for now is more than 2 times slower.

Anand Hariharan 04-02-2008 03:40 AM

Re: Standard C++ Library
 
On Wed, 02 Apr 2008 14:20:00 +1300, Ian Collins wrote:

> June Lee wrote:
>
> [Please don't top-post]
>

(...)
>> So there are 3 types of library / header in C++?
>>
>> CRT (C runtime library)
>> Standard C++ Library
>> Platform SDK for Visual C++

>
> No, there's the C++ standard library, which includes the C standard library.
>
> Anything else is platform specific.
>
> There are several cross-platform libraries that are in widespread use,
> boot being one.
>


To the OP -

Ian meant "... widespread use, /boost/ being one." (cf. www.boost.org)

- Anand


--
ROT-13 email address to reply

lbonafide@yahoo.com 04-02-2008 03:53 AM

Re: Standard C++ Library
 
On Apr 1, 10:25 pm, Razii <DONTwhatever...@hotmail.com> wrote:
> On Tue, 01 Apr 2008 17:49:24 -0700, June Lee <iiu...@yahoo.com> wrote:
> >It seem to me the Standard C++ Library have headers to mainipulate
> >string / characters, doing I/O, and data structure like Stack, Queue,
> >HashMap, Vector, time, bitwise operation, exception, iterator on a
> >collection ... etc

>
> Where is this HashMap container in the Standard C++ Library? Poor "Bo
> Persson" can't find it. Something he needs to speed up the word
> counting benchmark, which for now is more than 2 times slower.


What are you babbling about?

Ian Collins 04-02-2008 03:57 AM

Re: Standard C++ Library
 
Anand Hariharan wrote:
> On Wed, 02 Apr 2008 14:20:00 +1300, Ian Collins wrote:
>
>> June Lee wrote:
>>
>> [Please don't top-post]
>>

> (...)
>>> So there are 3 types of library / header in C++?
>>>
>>> CRT (C runtime library)
>>> Standard C++ Library
>>> Platform SDK for Visual C++

>> No, there's the C++ standard library, which includes the C standard library.
>>
>> Anything else is platform specific.
>>
>> There are several cross-platform libraries that are in widespread use,
>> boot being one.
>>

>
> To the OP -
>
> Ian meant "... widespread use, /boost/ being one." (cf. www.boost.org)
>

:)

--
Ian Collins.

Razii 04-02-2008 05:16 AM

Re: Standard C++ Library
 
On Tue, 1 Apr 2008 20:53:36 -0700 (PDT), lbonafide@yahoo.com wrote:


>What are you babbling about?


:)

Where is the HashMap container in c++ standard library?

Got it this time?

It makes a big difference in speed if you use std::map vs HashMap in
some situations. So where is the HashMap?



Yannick Tremblay 04-02-2008 11:11 AM

Re: Standard C++ Library
 
In article <aa56v39181p15lg3chqrimv483b8402tsn@4ax.com>,
Razii <DONTwhatevere3e@hotmail.com> wrote:
>On Tue, 1 Apr 2008 20:53:36 -0700 (PDT), lbonafide@yahoo.com wrote:
>
>
>>What are you babbling about?

>
>:)


Not sure why I am responding to what is mostly trolling but I'll take
your smiley and respond to face value.

>Where is the HashMap container in c++ standard library?


std::tr1::unordered_map

>It makes a big difference in speed if you use std::map vs HashMap in
>some situations. So where is the HashMap?


There's a key in the above sentence: "in some situation"

In many situation, both would do the job fine.
In some situation, a hash map is better.
In some situation, a balanced tree map is better
In some situation, a hash map is totally unacceptable.
In some situation, a balanced tree map is totally unacceptable.

Learning to figure out in which of the above situation you are is a
very important part of programming.

What are your requirements?
What are the typical performance requirements?
What are the worst case scenario requirements?

There are fairly fundamental performance differences between balanced
tree algorithm and hash algorith, one of the potentially important one
is worst case scenario search complexity. If like the
pseudo-benchmarks you write, you are only concerned about best
performance in one particular situation, the best solution might be
different than if you must make sure that your application performs
well in most cases and never ever perform worse than a set target.

If you are interested to learn, have a look at:
http://en.wikipedia.org/wiki/Hash_table
http://en.wikipedia.org/wiki/Red_black_tree

Note that the C++ standard doesn't requires that std::map be
implemented as a red-black tree. It only states complexity
requirements. Library implementors are free to choose whatever
algorithm they wish as long as it meets the requirements.

Yan



All times are GMT. The time now is 04:05 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.