incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <>
Subject Tests for string non-members - operators
Date Thu, 25 May 2006 14:47:54 GMT
Ported test for std::string non-members operators (+, ==, != , <=, >=,
<, >) are here:

Also there are required differences to strings.h/.cpp.

I noticed two problems with non-members:

1) _rw_sigcat forms incorrect formatted strings for non-members. The
cause is in additional shift in the for cycle:
    for (size_t argno = 0; argmap >>= Ids::arg_bits; ++argno) {

I guess it was done to process "self" flag bits for members.
I implemented workaround using NON_MEMBER_(N) (f, void, arg1, arg2, ...)
instead of NON_MEMBER_(N - 1) (f, arg1, arg2, ...) , i.e. definnig the

#define NON_MEMBER_2(f, a, b) \
        FID_2 (f, a, b) = SIG_3 (f, void, a, b)

But maybe there is another way to solve this problem...

2) The "=" symbol in _rw_func_names array brokes the command line
arguments parsing. I tried "operator==", "operator!=", etc and this
didn't work and
I used synonyms: "operator_equal", "operator_not_equal", etc instead. Is
there any way to allow the "=" using in operator's names?

Change Log:
2006-05-25  Anton Pevtsov <>

	* 21.strings.h (FuncId): Added new elements for non-members
	(NON_MEMBER_N): Changed to use SIG_N + 1 (f, void, a, ...) to 
	workaround problem with additional shift in _rw_sigcat.
	(OverloadId): Added new elements for non-members operators.
	* 21.strings.cpp (_rw_func_names): Added  new elements for 
	non-members operators - synonyms to avoid problems with
	command line arguments parsing
	(_rw_setvars): Updated to use full template arguments lis for
	method "header" format updated for non-members, added new cases
	for new OverloadId elements.

Also I suggest to extend the FuncId to 6 bits: there are at least 6
methods left (from the capacity test, begin(), end(), etc).
What do you think about this?

Anton Pevtsov

View raw message