|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2000-07-07 15:41:35
Hi. This is my first post to the list (I joined 1 Jul 2000).
I wonder how to propose changes to a file someone else is already working
on? Do I just post the changes to the list? Or do I upload an altered file
to the vault? Or do I try to contact the current people working on it?
The basic changes I want to make are to "operators.hpp." I want to add the
extensible operators that weren't included. The list of my proposed classes
are:
idempotent (no requirements, unary +)
left_shiftable (have <<=, get << for self or other type [non-commutative])
right_shiftable (have >>=, get >> for self or other type [non-commutative])
member_dereferenceable (have [unary]*, get member pointer for iterated type)
zero_default_quantifiable (default value equivalent to zero, get bool and !)
I wrote implementations of the above structs. The current maintainer can
add the appropriate BOOST_*_TEMPLATE? macros. (The *_shiftable classes are
really in *able1 and *able2 versions.)
I also have suggestions for new operator policy struct templates
1. binary_integral2 and binary_integral
+ like operators(2)
+ adds idempotent, left_shiftable, right_shiftable,
and zero_default_quantifiable
+ should act like the built-in integral types
(actually, you would also need ~ and possibly unary -)
2. place_value_integral2 and place_value_integral
+ like binary_integral(2)
- but removes bit operators (& | ^)
+ keeps << and >>, with shift by the radix instead of 2
+ (you would still have to add unary -, but not necessarily ~)
- no built-in type acts like this, AFAIK
3. floating_number2 and floating_number
+ like place_value_integral(2)
- but removes modulus (%) and shift (<< >>) operators
+ should act like the built-in floating types
(actually, you would also need unary -)
4. unordered_number2 and unordered_number
+ like floating_number(2)
- but removes ordered (< > <= >= ++ --) operators
+ should act like std::complex (floating) types
(actually, you would also need unary -)
You could use inheritance here (4->3->2->1 or (4->3 and 2->1)). That funky
empty-base setup in operators.hpp could be used instead of inheritance.
The member_dereferenceable struct should be added to the iterator helper
classes.
--
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk