Comments (7)
We can consider whether we want it to be a customization point, but it currently isn't one. Paragraph 2 of Clause 4 [namespaces] means that references to buffer_size
in the TS mean std::experimental::networking::v1::buffer_size
, so program-defined overloads wouldn't be found by ADL.
N.B. if we want basic_streambuf
to be usable as a buffer then we would need to provide a suitable overload ourselves in the TS, as it is undefined for the program to add an overload to namespace std
.
from networking-ts.
N.B. if we want
basic_streambuf
to be usable as a buffer
Let me clarify. Types meeting the requirements of DynamicBuffer, such as basic_streambuf
, define the "input area" and the "output area" which are themselves buffer sequences. So, the dynamic buffer is not the buffer sequence but rather, the two objects it provides. They are defined by the nested types const_buffers_type
and mutable_buffers_type
. For example:
https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/basic_streambuf.hpp#L122
I'm weakly in favor of having buffer_size
as a customization point, since buffer_size
for a beast::basic_streambuf::const_buffers_type
or beast::basic_streambuf::mutable_buffers_type
will have an execution time of O(N) where N is the number of buffers in its list:
https://github.com/vinniefalco/Beast/blob/master/include/beast/core/basic_streambuf.hpp#L74
With a customization point it could run in O(1):
https://github.com/vinniefalco/Beast/blob/master/include/beast/core/basic_streambuf.hpp#L242
Example implementation
template<class Allocator>
std::size_t
buffer_size(basic_streambuf<Allocator>::const_buffers_type const& cb)
{
return cb.sb_->size();
}
On the other hand, I realize that I'm bringing this up rather late in the game and I don't want to create a bunch of unnecessary work for anyone. What are your thoughts?
from networking-ts.
Good talk :)
from networking-ts.
This will be submitted as a national body comment on the PDTS. I don't have a personal opinion on this topic and Github issues are not the right place to do design work, that needs to happen elsewhere and then be approved by the C++ committee.
from networking-ts.
This was submitted as a National Body comment against the PDTS, and discussed by the Library Evolution Working Group, see https://issues.isocpp.org/show_bug.cgi?id=300
from networking-ts.
This has become a performance issue for a company, I would like to revisit this - what is the procedure for doing so?
from networking-ts.
Via the WG21 committee. The recommended response to the NB comment is not to make a change at this time (i.e. for v1 of the TS). If you want to persuade them otherwise you need to talk to the committee (and I won't be present at the next meeting to do so on your behalf).
from networking-ts.
Related Issues (20)
- [async.reqmts.proto.allocator] "No constructor ... shall exit via an exception" over-specification
- Where is the null_buffers? HOT 4
- const_buffer is a view HOT 4
- Add integer_option helper HOT 3
- [async.reqmts.async.handler.exec] refers to Executor1 from previous subclause
- [async.exec.binder] executor_binder and function types
- Unnecessary uses of DECAY_COPY HOT 1
- Fix use of "(possibly const) value of type" in requirements HOT 1
- Terms and Definitions don't follow ISO directives HOT 1
- [socket.streambuf.virtual] underspecified
- [internet.endpoint.extensible] condition too long to fit on one line
- Normative references section doesn't actually include any normative references HOT 1
- [async.reqmts.service] uses is_base_of_v HOT 2
- `execution_context` is not ExecutionContext
- Service cannot access associated Executor HOT 1
- No hanging paragraphs
- Use std::byte for bytes_type HOT 1
- Why return a default constructed ip address on failure?
- Question: RIP? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from networking-ts.