Someone has asked me what the relationship is, if any, between iostream
and the STL. My suspicion is that iostream uses some of the
functionality provided by the STL, but I have no actual kowledge on
which to base my suspicion. Anyone out there know? Please make you
answer as verbose as possible.
Thanks,
Bob 12 2182
blangela wrote:
Someone has asked me what the relationship is, if any, between iostream
and the STL. My suspicion is that iostream uses some of the
functionality provided by the STL, but I have no actual kowledge on
which to base my suspicion. Anyone out there know? Please make you
answer as verbose as possible.
The "STL" was a third party library that was brought into the standard
library. It behaved in certain ways and worked with certain concepts
not necissarily in compiler libraries at the time (I don't believe
there was a standard). When the STL became part of the standard
library parts of the implementation library changed to better work with
concepts in the STL. This includes string to which were added
iterators, and iostreams I believe - again, iterators where added.
Now days when people say "STL" they usually mean the C++ part of the
standard library (in otherwords not the C compat crap), which iostreams
are of course part of. IMHO the term should really be depricated but
whatever.
blangela wrote:
Someone
Who? Your instructor at school or your interviewer?
has asked me what the relationship is, if any, between
iostream and the STL. My suspicion is that iostream uses some of the
functionality provided by the STL, but I have no actual kowledge on
which to base my suspicion. Anyone out there know?
Implementors of the library know the most, of course.
Please make you
answer as verbose as possible.
First and foremost, 'iostream' is part of the Standard Library. If
by "STL" you mean the Standard Library, here is your relationship.
I am not saying that just to wave you off, it's important in the sense
that the design intent and philosophy behind streams is in tune with
the rest of the library.
The streams fit into the rest of the library in two major ways: they
define (overload) operators for inputting and outputting types defined
in the library (std::basic_string, for one), and they also provide
iterators for use in some library algorithms. Also, there is a certain
link (so to speak) between streams and locales.
Whether streams make any use of any other parts of the library
behind the scenes, is unspecified. They can use stream functionality
provided by the Standard C library. As to sorting, searching, copying
and other algorithms, I don't see why not. Allocators and other
memory management stuff as well.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Victor Bazarov wrote:
blangela wrote:
Someone
Who? Your instructor at school or your interviewer?
A colleage at work asked the question.
has asked me what the relationship is, if any, between
iostream and the STL. My suspicion is that iostream uses some of the
functionality provided by the STL, but I have no actual kowledge on
which to base my suspicion. Anyone out there know?
Implementors of the library know the most, of course.
Please make you
answer as verbose as possible.
First and foremost, 'iostream' is part of the Standard Library. If
by "STL" you mean the Standard Library,
I meant Standard Template Library by STL
here is your relationship.
I am not saying that just to wave you off, it's important in the sense
that the design intent and philosophy behind streams is in tune with
the rest of the library.
The streams fit into the rest of the library in two major ways: they
define (overload) operators for inputting and outputting types defined
in the library (std::basic_string, for one), and they also provide
iterators for use in some library algorithms. Also, there is a certain
link (so to speak) between streams and locales.
Whether streams make any use of any other parts of the library
behind the scenes, is unspecified. They can use stream functionality
provided by the Standard C library. As to sorting, searching, copying
and other algorithms, I don't see why not. Allocators and other
memory management stuff as well.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
blangela wrote:
Victor Bazarov wrote:
[..]
>First and foremost, 'iostream' is part of the Standard Library. If by "STL" you mean the Standard Library,
I meant Standard Template Library by STL
Do you mean the library that SGI publishes? Since 1998 there is
*Standard Library*. Vendorless STL doesn't exists since adoption of
the International Standard for C++ language. "STL" is an obsolete
term AFA C++ _language_ is concerned.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
On 16 Jan 2007 11:23:59 -0800, "blangela" wrote:
>Someone has asked me what the relationship is, if any, between iostream and the STL.
Apart from being later (partially) incorporated into the C++ Standard
both libraries presented something 'new' and 'cool' at the time they
were make public. In the early nineties iostreams came out with OO
design and fancy operator overloadings, in the mid nineties STL used a
value-oriented, anti-OO, generic 'paradigm' influenced by functional
programming. If they were not ennobled by the C++ Standard you would
hardly find those libraries in current C++ code.
Best regards,
Roland Pibinger
On Wed, 17 Jan 2007 10:25:43 +0000, Roland Pibinger wrote:
On 16 Jan 2007 11:23:59 -0800, "blangela" wrote:
>>Someone has asked me what the relationship is, if any, between iostream and the STL.
Apart from being later (partially) incorporated into the C++ Standard
both libraries presented something 'new' and 'cool' at the time they
were make public. In the early nineties iostreams came out with OO
design and fancy operator overloadings, in the mid nineties STL used a
value-oriented, anti-OO, generic 'paradigm' influenced by functional
programming. If they were not ennobled by the C++ Standard you would
hardly find those libraries in current C++ code.
Right! Of course I'd much rather use printf instead of std::cout <<, char*
instead of std::string, double* instead of std::vector<double>, ... but
hey, they're part of the C++ standard, so I'd better use them.
Piffle.
--
Lionel B
Lionel B wrote:
On Wed, 17 Jan 2007 10:25:43 +0000, Roland Pibinger wrote:
>On 16 Jan 2007 11:23:59 -0800, "blangela" wrote:
>>>Someone has asked me what the relationship is, if any, between iostream and the STL.
Apart from being later (partially) incorporated into the C++ Standard both libraries presented something 'new' and 'cool' at the time they were make public. In the early nineties iostreams came out with OO design and fancy operator overloadings, in the mid nineties STL used a value-oriented, anti-OO, generic 'paradigm' influenced by functional programming. If they were not ennobled by the C++ Standard you would hardly find those libraries in current C++ code.
Right! Of course I'd much rather use printf instead of std::cout <<, char*
instead of std::string, double* instead of std::vector<double>, ... but
hey, they're part of the C++ standard, so I'd better use them.
What you would prefer to use is very subjective of course but in the listed
cases there are clear technical advantages of using:
1. std::cout << instead of printf: mainly type safety and optimization
(better runtime speed), ie why not use the compile time lookup matching
types and argumets when looking for overloaded functions than telling
printf what types you will list (where you may get it wrong while the
compiler won't) also the same compiled code made to deal with various
things is generally worse optimizable than specific code ment to work with
specific types (ie an overloaded version of << than a general printf())
2. std::string instead of char*: providing safer method for string
manipulation (when not explicitely providing lengths for example) plus
simple things like always knowing the size of the string (and not having to
repeatedly call strlen() which is a O(n) operation)
3. std::vector<doubleinstead of double* (I supose you actually mean
instead of a C array of double because it's not the same thing with a
pointer in general thus no comparation is possible in general): not many
people know that the standard mandates that &v[0] is a contigous array that
can be manipulated externally (thus most people that wanted a C array
because they needed to work with legacy APIs can do it with std::vector
just fine) or that (most) implementations have specializations for using
std::copy() on std::vector::iterator and that in fact they actually call
memcpy and such in the cases where that is possible, etc
--
Dizzy http://dizzy.roedu.net
On Wed, 17 Jan 2007 16:36:43 +0200, Dizzy wrote:
Lionel B wrote:
>On Wed, 17 Jan 2007 10:25:43 +0000, Roland Pibinger wrote:
>>On 16 Jan 2007 11:23:59 -0800, "blangela" wrote: Someone has asked me what the relationship is, if any, between iostream and the STL.
Apart from being later (partially) incorporated into the C++ Standard both libraries presented something 'new' and 'cool' at the time they were make public. In the early nineties iostreams came out with OO design and fancy operator overloadings, in the mid nineties STL used a value-oriented, anti-OO, generic 'paradigm' influenced by functional programming. If they were not ennobled by the C++ Standard you would hardly find those libraries in current C++ code.
Sorry if it wasn't clear:
<irony>
>Right! Of course I'd much rather use printf instead of std::cout <<, char* instead of std::string, double* instead of std::vector<double>, ... but hey, they're part of the C++ standard, so I'd better use them.
</irony>
[snip]
--
Lionel B
Lionel B wrote:
On Wed, 17 Jan 2007 16:36:43 +0200, Dizzy wrote:
>Lionel B wrote:
>>On Wed, 17 Jan 2007 10:25:43 +0000, Roland Pibinger wrote:
On 16 Jan 2007 11:23:59 -0800, "blangela" wrote: >Someone has asked me what the relationship is, if any, between iostream >and the STL.
Apart from being later (partially) incorporated into the C++ Standard both libraries presented something 'new' and 'cool' at the time they were make public. In the early nineties iostreams came out with OO design and fancy operator overloadings, in the mid nineties STL used a value-oriented, anti-OO, generic 'paradigm' influenced by functional programming. If they were not ennobled by the C++ Standard you would hardly find those libraries in current C++ code.
Sorry if it wasn't clear:
<irony>
>>Right! Of course I'd much rather use printf instead of std::cout <<, char* instead of std::string, double* instead of std::vector<double>, ... but hey, they're part of the C++ standard, so I'd better use them.
</irony>
:) Got me on that, I didn't fully read the quoted statement above (lost me
arround "new and cool at the time") thus did not realised the irony...
--
Dizzy http://dizzy.roedu.net
Lionel B wrote:
On Wed, 17 Jan 2007 16:36:43 +0200, Dizzy wrote:
Lionel B wrote:
On Wed, 17 Jan 2007 10:25:43 +0000, Roland Pibinger wrote:
On 16 Jan 2007 11:23:59 -0800, "blangela" wrote: Someone has asked me what the relationship is, if any, between iostream and the STL.
Apart from being later (partially) incorporated into the C++ Standard both libraries presented something 'new' and 'cool' at the time they were make public. In the early nineties iostreams came out with OO design and fancy operator overloadings, in the mid nineties STL used a value-oriented, anti-OO, generic 'paradigm' influenced by functional programming. If they were not ennobled by the C++ Standard you would hardly find those libraries in current C++ code.
Sorry if it wasn't clear:
<irony>
Right! Of course I'd much rather use printf instead of std::cout <<, char*
instead of std::string, double* instead of std::vector<double>, ... but
hey, they're part of the C++ standard, so I'd better use them.
</irony>
Unfortunately there are those that feel this way and advocate prefering
such types even given the long list of technical reasons not to.
On Wed, 17 Jan 2007 14:21:43 +0000 (UTC), "Lionel B" wrote:
>Right! Of course I'd much rather use printf instead of std::cout <<, char* instead of std::string, double* instead of std::vector<double>, ... but hey, they're part of the C++ standard, so I'd better use them.
As if C Standard libraries were the only imaginable alternatives to
STL and iostreams - probably for you.
On Wed, 17 Jan 2007 17:06:11 +0000, Roland Pibinger wrote:
On Wed, 17 Jan 2007 14:21:43 +0000 (UTC), "Lionel B" wrote:
>>Right! Of course I'd much rather use printf instead of std::cout <<, char* instead of std::string, double* instead of std::vector<double>, ... but hey, they're part of the C++ standard, so I'd better use them.
As if C Standard libraries were the only imaginable alternatives to
STL and iostreams - probably for you.
Yes, there are "imaginable alternatives": I could use C-style I/O (but I
find it clunkier and more error-prone than C++-style I/O). I could use raw
pointers and do my own memory allocation (but I find it clunkier and more
error-prone than eg. std::vector). I could write my own I/O wrappers or
containers (but life is too short to re-invent wheels). I could use
third-party I/O systems or containers or "semi-standard" libraries like
Boost (I occasionally do if they offer some advantage/functionality over
the standard facilities).
So I use C++-style I/O and standard containers because:
1) They work very nicely for me.
2) They are standard! Therefore my code is far more likely to be
comprehensible to others than non-standard stuff.
3) I don't want to re-invent wheels.
4) I have invested a good deal of time and effort to familiarise myself
with their paradigms and learn their usage.
--
Lionel B This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Alcyone Oliveira |
last post by:
------=_NextPart_000_000D_01C36572.F6480CE0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_000E_01C36572.F6480CE0"
------=_NextPart_001_000E_01C36572.F6480CE0
Content-Type:...
|
by: MJ |
last post by:
Hi
I have a following sample code
class base and class derived.
I have inherited the base class as private and tried to compile the
code its giving an error
"conversion from 'class derived *' to...
|
by: Naga |
last post by:
Hello,
Thanks for the response Oleg. Now I need to know few answers. How do I
get the value of a node using the xpath. I want the value of the MessageID
and ResultCode from secondxml. And using...
|
by: Larry R Harrison Jr |
last post by:
I have an Access 97 database with 2 tables that have a one-many
relationship. I have a SQL statement in the "one" table which I want to
execute and insert 7 records into the "many" table, and I...
|
by: shumaker |
last post by:
....please.
I've found other posts that explain the Cascade options, but the
Enforce relationships option still is foggy to me.
As to "enforcing relationship for ... UPDATEs"(with cascade NOT...
|
by: Joey Lee |
last post by:
Hi,
I have created a dataset schema(*.xsd) which contain two element
"InvoiceHeader" and "InvoiceDetail".
I set the primary key of both the element. for example "InvoiceHeader" -> id
and...
|
by: BrianDP |
last post by:
This is a strange one--
I have an Access 2K database with a split front end/back end. There
are two tables in the back end - RFile and RLine. There is a one to
many relationship from...
|
by: Pino |
last post by:
HI all,
I am learning c++ ( just 1 month) and would want an aid for a code.
I have a integer vector of length N.
ie
3
3
3
4
4
1
|
by: Phil Stanton |
last post by:
Having spent ages sorting out the layout of my relationship window with
about 60 tables and getting it all tidy and with enough of the tables
visible to show the PK an FK relaionshipsOn a subseqent...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| | |