Function at

Summary

#include <include/EASTL/string.h>

(1) reference at(size_type n)

(2) const_reference at(size_type n) const

Function overload

Synopsis

#include <include/EASTL/string.h>

reference at(size_type n)

Description

No description yet.

Source

Lines 1512-1525 in include/EASTL/string.h. Line 612 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::reference
basic_string<T, Allocator>::at(size_type n)
{
    #if EASTL_STRING_OPT_RANGE_ERRORS
        if(EASTL_UNLIKELY(n >= internalLayout().GetSize()))
            ThrowRangeException();
    #elif EASTL_ASSERT_ENABLED                  // We assert if the user references the trailing 0 char.
        if(EASTL_UNLIKELY(n >= internalLayout().GetSize()))
            EASTL_FAIL_MSG("basic_string::at -- out of range");
    #endif
    return internalLayout().BeginPtr()[n];
}

Synopsis

#include <include/EASTL/string.h>

const_reference at(size_type n) const

Description

No description yet.

Source

Lines 1496-1509 in include/EASTL/string.h. Line 613 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline typename basic_string<T, Allocator>::const_reference
basic_string<T, Allocator>::at(size_type n) const
{
    #if EASTL_STRING_OPT_RANGE_ERRORS
        if(EASTL_UNLIKELY(n >= internalLayout().GetSize()))
            ThrowRangeException();
    #elif EASTL_ASSERT_ENABLED                  // We assert if the user references the trailing 0 char.
        if(EASTL_UNLIKELY(n >= internalLayout().GetSize()))
            EASTL_FAIL_MSG("basic_string::at -- out of range");
    #endif
    return internalLayout().BeginPtr()[n];
}





Add Discussion as Guest

Log in