Hi Wei, > and might actually slow down execution a bit. I should probably qualify this a bit: [1].
Also see the section on ROMability. Getting to a std::string's data through c_str() or data() might have implications in embedded systems where const could really mean const. Getting at a vector<byte>'s data through &v[0] does not suffer the same limitation. Jeff [1] Technical Report on C++ Performance, http://www.open-std.org/jtc1/sc22/wg21/docs/TR18015.pdf On Sep 5, 4:08 pm, Jeffrey Walton <[email protected]> wrote: > Hi Wei, > > Would it be possible to look at adding a binary string type or class > to Crypto++ to relieve the use of std::string? A binary string seems > to be the intent and usage of most std::strings. > > std::string's bring in locales and facets, which (the best that I can > tell) add no real value to the library, and might actually slow down > execution a bit. In addition, a trait, facet, and locale have no > relevance to a binary string (perhaps a binary string could have an > trait or attribute for secure deletion?). > > Out of curiosity, what was the motivation for using a std::string over > a class derived from vector<byte>? If it was the contiguous memory > requirement, I believe modern versions of C++ ISO unambiguously > require memory to be contiguous for a vector (see ISO 14882, 23.2.4). > > Jeff -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
