Help me find a good typedef name for the following type

E

Eric Lilja

Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std::pair<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.

/ Eric
 
M

Martijn Mulder

Eric said:
Hello, got an odd question. I need a good typedef name
for the type:
std::vector<std::vector<std::pair<std::string,
std::string> > >

Even with using-statements to get rid of std:: it's
simply too long and makes for keeping lines within a
length of 80 columns cumbersome.

I am using an object of that type to store matching rows
(with a varying number of non-NULL columns) from an SQL
database. The first string in the pair holds the field
name and the second the field value.

/ Eric

How about vvpss
 
M

Mikhail Polatov

Eric Lilja said:
Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std::pair<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.

/ Eric

typedef std::pair<std::string, std::string> column_value_t;
typedef std::vector<column_value_t> record_t;
typedef std::vector<record_t> table_t;
 
A

Alf P. Steinbach

* Eric Lilja:
Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std::pair<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.

Possibly you'd be better off by representing the NULL columns explicitly,
and store the field names just once, in a separate vector.

However,

typedef std::pair<std::string, std::string> NameValuePair;
typedef std::vector<NameValuePair> DbResultRow;
typedef std::vector<DbResultRow> DbResultTable;
typedef DbResultTable DbView;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top