I read some GCC bugreport and people there were talking about "vstring". Searching the WEB I came to notice http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/vstring_8h.html .
Can someone please elaborate on what it is useful and used for? Why use it instead of std::string?
gcc -s: Remove all symbol table and relocation information from the executable. strip: Discard symbols from object files. Do they have the same meaning? reduce the size of executable? speed up its running? Show activity on this post. gcc being a compiler/linker, its -s option is something done while linking.
The different options of gcc command allow the user to stop the compilation process at different stages. Syntax: gcc [-c|-S|-E] [-std=standard] Example: This will compile the source.c file and give the output file as a.out file which is default name of output file given by gcc compiler, which can be executed using ./a.out gcc source.c
GCC stands for GNU Compiler Collections which is used to compile mainly C and C++ language. It can also be used to compile Objective C and Objective C++. The most important option required while compiling a source code file is the name of the source program, rest every argument is optional like a warning, debugging, linking libraries, object ...
Essentially, string is the most limited type and has a length that does not vary much and only contains simple Latin-1 characters. V_string also contains simple Latin-1 characters but can have a varying length.
GCC's vstring
is a versatile string class, which was introduced in GCC 4.1's libstdc++
implementation.
It is compatible with std::basic_string
, with these additional details:
vstring_fwd.h
for some useful typedefs.DR431 is Library Working Group Defect Report 431, with option 3 looking like implementing better allocator support for the class to allow better swapping and other allocator-related operations.
The basic details are from GCC 4.1's release notes, under the Runtime Library section.
edit:
It looks as though the original purpose of this extension was to provide a basis for a C++11 std::string
implementation. Paolo Carlini, a GCC/libstdc++ contributor, comments in this GCC Bug Report that <ext/vstring.h>
contains a non-reference counted experimental version of the next std::string
. Comment dated April 12, 2012:
What we tried to explain is that this sort of issue is well known and, more or less, affects any reference counted implementation... That is not the case when reference counting is not used and indeed it will not be used (per the new C++11 Standard) in a new implementation of
std::string
which we are currently showcasing as<ext/vstring.h>
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With