Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
core.stdcpp.string
D header file for interaction with C++ std::string.
License:
Distributed under the
Boost Software License 1.0.
(See accompanying file LICENSE)
Authors:
Guillaume Chatelet
Manu Evans
Source core/stdcpp/string.d
- enum DefaultConstruct
Default
; - Constructor argument for default construction
- struct
char_traits
(CharT); - Character traits classes specify character properties and provide specific semantics for certain operations on characters and sequences of characters.
- struct
basic_string
(T, Traits = char_traits!T, Alloc = allocator!T); - D language counterpart to C++ std::basic_string.
- enum size_type
npos
; - alias
size_type
= size_t; - alias
difference_type
= ptrdiff_t; - alias
value_type
= T; - alias
traits_type
= Traits; - alias
allocator_type
= Alloc; - alias
pointer
= value_type*; - alias
const_pointer
= const(value_type)*; - alias
toString
= as_array; - this();
- MSVC allocates on default initialisation in debug, which can't be modelled by D struct
- alias
length
= size; - alias
opDollar
= length; - const nothrow @safe bool
empty
(); - const pure nothrow @nogc @safe size_t[2]
opSlice
(size_t dim : 0)(size_tstart
, size_tend
); - inout pure nothrow @nogc ref @safe inout(T)
opIndex
(size_tindex
); - inout pure nothrow @nogc @safe inout(T)[]
opIndex
(size_t[2]slice
); - inout pure nothrow @nogc @safe inout(T)[]
opIndex
(); - void
clear
(); - @trusted void
resize
(size_typen
, Tc
= T(0)); - inout nothrow ref @safe inout(T)
front
(); - inout nothrow ref @safe inout(T)
back
(); - const nothrow @safe const(T)*
c_str
(); - ref basic_string
opAssign
()(auto ref basic_stringstr
); - ref basic_string
opAssign
(const(T)[]str
); - ref basic_string
opAssign
(Tc
); - ref basic_string
opIndexAssign
(Tc
, size_tindex
); - ref basic_string
opIndexAssign
(Tc
, size_t[2]slice
); - ref basic_string
opIndexAssign
(const(T)[]str
, size_t[2]slice
); - ref basic_string
opIndexAssign
(Tc
); - ref basic_string
opIndexAssign
(const(T)[]str
); - ref basic_string
opIndexOpAssign
(string op)(Tc
, size_tindex
); - ref basic_string
opIndexOpAssign
(string op)(Tc
, size_t[2]slice
); - ref basic_string
opIndexOpAssign
(string op)(const(T)[]str
, size_t[2]slice
); - ref basic_string
opIndexOpAssign
(string op)(Tc
); - ref basic_string
opIndexOpAssign
(string op)(const(T)[]str
); - ref basic_string
append
(Tc
); - ref basic_string
opOpAssign
(string op : "~")(const(T)[]str
); - ref basic_string
opOpAssign
(string op : "~")(Tc
); - ref basic_string
erase
(size_typepos
= 0); - ref basic_string
erase
(size_typepos
, size_typelen
); - @trusted void
push_back
(Tc
); - void
pop_back
(); - this(DefaultConstruct);
- this(const(T)[]
str
); - this(const(T)[]
str
, ref const(allocator_type)al
); - inout ref inout(Alloc)
get_allocator
(); - const nothrow @safe size_type
max_size
(); - const nothrow @safe size_type
size
(); - const nothrow @safe size_type
capacity
(); - inout @safe inout(T)*
data
(); - inout nothrow @trusted inout(T)[]
as_array
(); - inout nothrow ref @trusted inout(T)
at
(size_typei
); - ref basic_string
assign
(const(T)[]str
); - ref basic_string
append
(const(T)[]str
);
Copyright © 1999-2022 by the D Language Foundation | Page generated by
Ddoc on (no date time)