Function operator=

Summary

#include <include/EASTL/string.h>

(1) this_type & operator=(const this_type &x)

(2) this_type & operator=(const value_type *p)

(3) this_type & operator=(value_type c)

(4) this_type & operator=(std::initializer_list< value_type > ilist)

(5) this_type & operator=(view_type v)

(6) this_type & operator=(this_type &&x)

Function overload

Synopsis

#include <include/EASTL/string.h>

this_type & operator=(const this_type &x)

Description

Operator=.

Source

Lines 1225-1248 in include/EASTL/string.h. Line 535 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::this_type& basic_string<T, Allocator>::operator=(const this_type& x)
{
    if(&x != this)
    {
        #if EASTL_ALLOCATOR_COPY_ENABLED
            bool bSlowerPathwayRequired = (get_allocator() != x.get_allocator());
        #else
            bool bSlowerPathwayRequired = false;
        #endif
        if(bSlowerPathwayRequired)
        {
            set_capacity(0); // Must use set_capacity instead of clear because set_capacity frees our memory, unlike clear.
            #if EASTL_ALLOCATOR_COPY_ENABLED
                get_allocator() = x.get_allocator();
            #endif
        }
        assign(x.internalLayout().BeginPtr(), x.internalLayout().EndPtr());
    }
    return *this;
}

Synopsis

#include <include/EASTL/string.h>

this_type & operator=(const value_type *p)

Description

No description yet.

Source

Lines 1294-1298 in include/EASTL/string.h. Line 536 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::this_type& basic_string<T, Allocator>::operator=(const value_type* p)
{
    return assign(p, p + CharStrlen(p));
}

Synopsis

#include <include/EASTL/string.h>

this_type & operator=(value_type c)

Description

No description yet.

Source

Lines 1300-1304 in include/EASTL/string.h. Line 537 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::this_type& basic_string<T, Allocator>::operator=(value_type c)
{
    return assign((size_type)1, c);
}

Synopsis

#include <include/EASTL/string.h>

this_type & operator=(std::initializer_list< value_type > ilist)

Description

No description yet.

Source

Lines 1314-1318 in include/EASTL/string.h. Line 538 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::this_type& basic_string<T, Allocator>::operator=(std::initializer_list<value_type> ilist)
{
    return assign(ilist.begin(), ilist.end());
}

Synopsis

#include <include/EASTL/string.h>

this_type & operator=(view_type v)

Description

No description yet.

Source

Lines 1321-1325 in include/EASTL/string.h. Line 539 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::this_type& basic_string<T, Allocator>::operator=(view_type v)
{
    return assign(v.data(), static_cast<this_type::size_type>(v.size()));
}

Synopsis

#include <include/EASTL/string.h>

this_type & operator=(this_type &&x)

Description

No description yet.

Source

Lines 1307-1311 in include/EASTL/string.h. Line 540 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::this_type& basic_string<T, Allocator>::operator=(this_type&& x)
{
    return assign(eastl::move(x));
}





Add Discussion as Guest

Log in