Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Sepplesox

Name: Anonymous 2011-07-24 21:05

Just tell me one thing about Sepplesox:  Can I have a container1 of mixed types2,3?  If the answer is no, then you can keep it and I'll stick with C, thank you.
1 vector, etc, not something custom
2 not a "vector of pointers," but a vector of actual objects of different classes
3 it's fine if the types are required to share the same base class, e.g. vector<shape> shapes = { circle, square, triangle };

Name: Anonymous 2011-07-24 21:18

>>1
You don't understand how C++ works at even basic levels.

Name: Anonymous 2011-07-24 21:59

>>2
Incorrect.  Also, C++ was not mentioned anywhere in the post.  Only C++0x and C.  Eat a dick

Name: Anonymous 2011-08-08 13:39

mmkay so this is a "no" then.

Name: SOCKS 2011-08-08 13:53

SOCKS

Name: Anonymous 2011-08-08 14:06

>>3
L0L!

Name: Anonymous 2011-08-08 14:11

I has a function that takes a vector of Pet*s
I want to pass it a vector of Dog*s

you can't explain that!

Name: Anonymous 2011-08-08 14:47

>>1
Of all of sepples' many failings, this is surely the worst.  Take C (fine just the way it was) and give it objects because supposedly that's much more intuitive.  Ok, I think I get it, so let me just try to do the "intuitive" thing and create a bunch of objects with a common base class and put them in a container.

sepples.cpp(42) : error C2039: YOU WANT TO DO WHAT?  THAT'S ABSURD.

Oh, ok, I guess I'm supposed to use an array of pointers to the objects...  but that means they have to be on the heap and I have to manage the memory myself?  Ok, I'll just make an auto-pointer thing that deletes itself... Oh, now I've violated the semantics of std::vector...  Oh, you say I should just download boost and use that?  Oh, good, it's only 20000 files, that seems reasonable.  Now I can have a vector of shapes, at last!  I'm glad someone finally solved the non-intuitiveness of C.

Name: Anonymous 2011-08-08 15:29

>>1
Yes. C++11 has a std::tuple template class.

struct foo { int a; } a = { 0 };
int b = 1;
float c = 4.4f;

auto t = std::make_tuple(a, b, c); // type of t is std::tuple<foo, int, float>
std::cout << std::get(t, 1) << std::endl; // prints '1'

Name: Anonymous 2011-08-08 16:35

ooc.util.vector

Name: Anonymous 2011-08-08 19:19

classes and hierarchies are overrated. evolve to roles.

Name: Anonymous 2011-08-08 19:21

>>11
roles/mixins are bullshit too. can't we all just go back to composing functions and procedures that transform data?

Name: Anonymous 2011-08-08 19:23

>>12
I've been there the whole time :)

Name: Anonymous 2011-08-08 21:51

>>12
have you used roles at least once? or you are just trolling?

Name: Anonymous 2011-08-08 22:05

>>11-14
MULTIMETHODS BABY, HELL YEAH

Name: Anonymous 2011-08-08 23:47

>>11
The point of >>1 isn't that OOP is inherently flawed, just that C++ doesn't implement classes in a particularly useful way.  Regardless, I don't see much advantage to roles over classes, anyway.

Name: Anonymous 2011-08-18 17:18

>>9
Unfortunately, tuples aren't very useful and aren't equivalent to what >>1 is seeking.  Tuples are just a glorified struct.  They can't push_back(), for example.

Don't change these.
Name: Email:
Entire Thread Thread List