Opened 12 years ago
Closed 12 years ago
#4280 closed Feature Requests (duplicate)
Cannot get array type from boost::array
| Reported by: | anonymous | Owned by: | Marshall Clow | 
|---|---|---|---|
| Milestone: | Boost 1.43.0 | Component: | array | 
| Version: | Boost 1.44.0 | Severity: | Optimization | 
| Keywords: | Cc: | 
Description
There is no function to get array from the boost::array. c_array returns pointer, and operator[] returns reference.
There must be additional function, as_array.
array<T, N> {
typedef T array_type[N];
array_type& as_array() { return elems; } array_type const& as_array() const { return elems; }
}
It is needed to allow optimizations when function has special overload for arrays. Like std::copy in VC compiler:
- copy(Input first, Input last, Output dest)
 - copy(Input first, Input last, OutElem (&dest)[size])
 
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
| Type: | Bugs → Feature Requests | 
|---|
There is a solution to use elems public member. It is nicer to have a method for this.
comment:5 by , 12 years ago
| Resolution: | → duplicate | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
Sorry for missing code formatting.