C++ ---> HTML

Pages: 12
Apr 20, 2010 at 9:13pm
@chrisname:
That's rather stupid that a C++ function wouldn't take C++ types as arguments, don't you think? :/

-Albatross
Apr 21, 2010 at 7:17am
No, I don't. std::fstream and std::string are separate libraries. A const char* is native, so it doesn't require a library to handle. That way, the libraries aren't inter-dependant.
Apr 21, 2010 at 9:01am
+1 chris.
Apr 21, 2010 at 9:35am
IMHO it was a bad design choice, but IIRC that is going to be fixed in C++0x
Apr 21, 2010 at 12:02pm
That's stupid. Now, to open a file, I have to include the string library too?
Apr 21, 2010 at 12:08pm
bad design? why? o.O
Apr 21, 2010 at 1:03pm
That's stupid. Now, to open a file, I have to include the string library too?
Nope, it will be included in fstream
bad design? why? o.O
Because C++ strings are std::string, not char arrays
Apr 21, 2010 at 1:14pm
that's why it has the method c_str(), is it still bad? so using containers like strings and vectors are bad design?
Apr 21, 2010 at 1:24pm
uh? I meant that was bad for file streams not taking a std::string as argument
Apr 21, 2010 at 1:28pm
i see.
Apr 21, 2010 at 3:08pm
They could have had an #ifdef #define #endif clause for adding string support to std::fstream.

It's neat to have separate libraries, but it's even neater to have libraries that work purfectly with each other, no?

-Albatross
Apr 21, 2010 at 3:18pm
They are both part of the standard library, not of separate libraries
Apr 21, 2010 at 3:20pm
+1 Bazzy
Apr 21, 2010 at 3:27pm
Chris:
No, I don't. std::fstream and std::string are separate libraries. A const char* is native, so it doesn't require a library to handle. That way, the libraries aren't inter-dependant.

Bazzy:
They are both part of the standard library, not of separate libraries


Well... I see you and chrisname need to have chat about that.

And I stand by my "it's even neater to have libraries that work purfectly with each other, no?"

-Albatross
Topic archived. No new replies allowed.
Pages: 12