
29 Mar
2011
29 Mar
'11
3:31 p.m.
Hi, A lot of functions take a const void*, size_t pair as two parameters. This is then cast to a const unsigned char* for further processing. Two parameters means you can't easily pass the result of an expression or function call. One parameter would be handier. const std::string& is also used frequently. However, this forces the caller to use (or construct) std::string, which is undesirable and unnecessary. A solution seems simple: data_ref and string_ref, which represent a pointer pair (void/unsigned char and char respectively). string_ref can replace const std::string&, data_ref can replace const void*, size_t. I think this would be a nice addition to Boost. Is there any interest in a library that solves this problem? -- Olaf