Do std::list/vector, boost::unorder_map, etc. have good copy constructors? or do I need to return by reference? if so, I guess that means I have to wrap them in shared_ptr's? what about shared_array?
This is sort of just an example...
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef std::vector<Row> RowList;
RowList FetchRow();
RowList FetchRowList();
or
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef std::vector<Row> RowList;
Row& FetchRow();
RowList& FetchRowList();
or
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef std::vector<boost::shared_ptr<Row> > RowList;
Row FetchRowList();
RowList FetchRowList();
or
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef std::vector<boost::shared_ptr<Row> > RowList;
Row& FetchRow();
RowList& FetchRowList();
or
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef boost::shared_ptr<Row> pRow;
typedef std::vector<Row> RowList;
pRow FetchRow();
RowList FetchRowList();
or
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef boost::shared_ptr<Row> pRow;
typedef std::vector<pRow> RowList;
pRow FetchRow();
RowList& FetchRowList();
or
Code:
typedef boost::unordered_map<std::string, std::string> Row;
typedef boost::shared_ptr<Row> pRow;
typedef std::vector<pRow> RowList;
typedef boost::shared_array<RowList> pRowList;
pRow FetchRow();
pRowList FetchRowList();
//pRowList r(new RowList); return r;
etc.
Last one?
Thanks guys!!