Re: [Boost-bugs] [Boost C++ Libraries] #5929: empty(), data(), size()

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5929: empty(), data(), size()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-23 11:36:20


#5929: empty(), data(), size()
-----------------------------------+----------------------------------------
  Reporter: olafvdspek@… | Owner: daniel_frey
      Type: Feature Requests | Status: closed
 Milestone: To Be Determined | Component: operators
   Version: Boost 1.47.0 | Severity: Problem
Resolution: wontfix | Keywords:
-----------------------------------+----------------------------------------

Comment (by anonymous):

 Replying to [comment:1 daniel_frey]:
> a) Domain
> b) Naming - How would you call the new base classes? emptyable? data-
 able? I don't see any obvious names for them.

 If the functionality provided is good, those issues should not be deal
 breakers.

 BTW, iterator support doesn't sound like arithmetic either.

> c) Efficiency - If end() is O(n), so are empty(), data() and size(),
 although O(1) might be possible.

 Is O(n) allowed for end()?

> Are we sure users get that or that it is unlikely enough to not be a
 problem?

 I think it's not a problem.

> d) Convenience - The (IMHO) real power of the operators library is, that
 there are groups of operators and **that** saves you from typing the same
 code over and over again. Plus that we ensure exploiting optimizations
 (RVO/NRVO) that some people might otherwise miss. For your case, there
 doesn't seem to be much gained by replacing the proposed functions by a
 base class each.

 You already have indexable. Doesn't indexable imply random access? If not,
 don't you have the same O issue as end() you raised above?
 I think indexable implies empty(), data() and size() being suitable
 functions.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5929#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC