I grew up learning how to customize data structures using OOP. But now that I’m learning more about C ++, STL, and Boost, I’ve found that many of my data structure needs can be met by combining STL classes into more complex composites, such as:
typedef std::map<std::string, std::map<std::string, int> > CSVData;
Obviously, there are limitations to this when I need to mix data types, but I usually avoid OOP when I can, in favor of these STL composites, for their simplicity. Is this a common progression? Are there best practice rules when it's best to define your own class? Are there any common problems?
: , typedefs, ?
. ( , , , - ), : . 1001-1255.
.. : , , - . typedef : CSV .
typedef: , , ( , ...). , , typedefd.
, , , .
: .
, ( ): typedef - . : CSV- . , . .
, ++ , : , ( IO) -: . , .
, OO , . , , .
, , :
typedef ( , /).
( ) , : , / :
, typedef , . .
, Effective ++ (Third Edition) , ++ . - . (STL-) - . .
, , . , , . , , , .
, - , . OO, .
, .
@adrian-mccarthy, ++ - , .
- .
typedef , templatize , . ( , .)
typedef
templatize, , ( ). , .