incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: naming convention for container members
Date Mon, 27 Mar 2006 14:50:52 GMT
I agree with this naming convetion. And I think that it will be useful
to have a common header with these enums.
Shall we rename options (rw_opt_no_replace_...) according to this
conversion too?

Martin Sebor wrote:
>Once we have a nice general naming convention worked out we can move
these names to a common header and reuse it in other tests, and perhaps
also in the driver itself. Come to think of it,   >that might be the way
to simplify the terribly complex assert strings and conditions. We could
add a formatting directive taking the name of the container
(basic_string, vector, etc.), the names of >its template arguments, and
the member function tag or id and the values of the function arguments,
and have it format the whole thing. This will need some thought but I
like it! :)

Great idea! It can significantly simplify the asserts. I'll think about
how to implement it too.

Thanks,
Anton Pevtsov.


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Sunday, March 26, 2006 01:11
To: stdcxx-dev@incubator.apache.org
Subject: naming convention for container members


Here's a proposed naming convention for the id tags used in string and
(in the future) container tests. All the tags should probably have some
prefix clearly identifying them as members of the same family (e.g., CF_
for Container Function or CM_ for Container Member, or something short
like that).

Anton, let me know if it makes sense to you or if you have a better
idea. Once we finalize the names I'd like to define the enumerations in
a common header and start using them throughout the container and string
tests.

Martin

##################
### ALL CONTAINERS

# CTOR:
cons_default:        C ();
cons_copy:           C (const C&);
cons_alloc:          C (const allocator_type&);
cons_size:           C (size_type);
cons_size_val:       C (size_type, const T&);
cons_size_val_alloc: C (size_type, const T&, const allocator_type&);
cons_range:          C (InputIterator, InputIterator);
cons_range_alloc:
     C (InputIterator, InputIterator, const allocator_type&);


# ASSIGN:
op_assign:       operator=(const C&);
assign_size_val: assign (size_type, const T&);
assign_range:    assign (InputIterator, InputIterator);

# INSERT:
insert_val:      insert (iterator, const T&);
insert_size_val: insert (iterator, size_type, const T&);
insert_range:    insert (iterator, InputIterator, InputIterator);

# ERASE:
erase:       erase (iterator);
erase_range: erase (iterator, iterator);

###############;
### STRING ONLY;

# CTOR:
cons_str_off:            S (const S&, size_type);
cons_str_off_size:       S (const S&, size_type, size_type);
cons_str_off_size_alloc:
     S (const S&, size_type, size_type, const allocator_type&);

cons_ptr:           S (const charT*);
cons_ptr_alloc:     S (const charT*, const allocator_type&);
cons_ptr_off:       S (const charT*, size_type);
cons_ptr_off_alloc: S (const charT*, size_type, const allocator_type&);
cons_ptr_off_size:  S (const charT*, size_type, size_type);
cons_ptr_off_size_alloc:
     S (const charT*, size_type, size_type, const allocator_type&);

# ASSIGN:
op_assign_ptr:       operator= (const charT*);
op_assign_val:       operator= (charT);
assign_str_off_size: assign (const S&, size_type, size_type);
assign_ptr:          assign (const charT*);
assign_ptr_off:      assign (const charT*, size_type);

# APPEND:
op_append_str:       operator+= (const S&);
op_append_ptr:       operator+= (const charT*);
op_append_val:       operator+= (charT);
append_str:          append (const S&);
append_str_off_size: append (const S&, size_type, size_type);
append_ptr:          append (const charT*);
append_ptr_off:      append (const charT*, size_type);
append_val_size:     append (charT, size_type);
append_range:        append (InputIterator, InputIterator);

# INSERT:
insert_off_str:          insert (size_type, const S&);
insert_off_str_off_size: insert (size_type, const S&, size_type,
size_type);
insert_off_ptr:          insert (size_type, const charT*);
insert_off_ptr_size:     insert (size_type, const charT*, size_type);
insert_off_size_val:     insert (size_type, size_type, charT);

# ERASE:
erase_void:     erase ();
erase_off:      erase (size_type);
erase_off_size: erase (size_type, size_type);

# REPLACE;
replace_off_size_str:      replace (size_type, size_type, const S&);
replace_off_size_str_off_size:
     replace (size_type, size_type, const S&, size_type, size_type);
replace_off_size_ptr:       replace (size_type, size_type, const
charT*);
replace_off_size_ptr_off:
     replace (size_type, size_type, const charT*, size_type);
replace_off_size_size, val: replace (size_type, size_type, size_type, 
charT);

replace_str:      replace (iterator, iterator, const S&);
replace_ptr:      replace (iterator, iterator, const charT*);
replace_ptr_size: replace (iterator, iterator, const charT*, size_type);
replace_size_val: replace (iterator, iterator, size_type, charT);
replace_range:    replace (iterator, iterator, InputIterator, 
InputIterator);

# COPY:
copy_ptr_size:     copy (charT*, size_type);
copy_ptr_size_off: copy (charT*, size_type, size_type);

Mime
View raw message