Function back

Summary

#include <include/EASTL/string.h>

(1) reference back()

(2) const_reference back() const

Function overload

Synopsis

#include <include/EASTL/string.h>

reference back()

Description

No description yet.

Source

Lines 1558-1570 in include/EASTL/string.h. Line 616 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::reference
basic_string<T, Allocator>::back()
{
    #if EASTL_ASSERT_ENABLED && EASTL_EMPTY_REFERENCE_ASSERT_ENABLED
        if (EASTL_UNLIKELY(internalLayout().GetSize() <= 0)) // We assert if the user references the trailing 0 char.
            EASTL_FAIL_MSG("basic_string::back -- empty string");
    #else
        // We allow the user to reference the trailing 0 char without asserting.
    #endif
    return *(internalLayout().EndPtr() - 1);
}

Synopsis

#include <include/EASTL/string.h>

const_reference back() const

Description

No description yet.

Source

Lines 1573-1585 in include/EASTL/string.h. Line 617 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::const_reference
basic_string<T, Allocator>::back() const
{
    #if EASTL_ASSERT_ENABLED && EASTL_EMPTY_REFERENCE_ASSERT_ENABLED
        if (EASTL_UNLIKELY(internalLayout().GetSize() <= 0)) // We assert if the user references the trailing 0 char.
            EASTL_FAIL_MSG("basic_string::back -- empty string");
    #else
        // We allow the user to reference the trailing 0 char without asserting.
    #endif
    return *(internalLayout().EndPtr() - 1);
}





Add Discussion as Guest

Log in