pos_out = pos;
return false;
#else
+ //::_sys::debug("map::_search (m_size=%i)", m_size);
for( size_type pos = 0; pos < m_size; pos ++ )
{
const key_type& item_key = m_items[pos].first;
continue;
}
else if( m_comp(k, item_key) ) {
+ //::_sys::debug("map::_search - Passed %i", pos);
pos_out = pos;
return false;
}
else {
+ //::_sys::debug("map::_search - Found %i", pos);
pos_out = pos;
return true;
}
}
+ //::_sys::debug("map::_search - Off end %i", m_size);
pos_out = m_size;
return false;
#endif
void insert_at(size_type ofs, const value_type& val) {
//assert( ofs == 0 || m_comp(m_items[ofs-1].first, val.first) );
//assert( ofs == m_size || m_comp(m_items[ofs].first, val.first) );
- ::_sys::debug("map::insert_at(%i,)", ofs);
+ //::_sys::debug("map::insert_at(%i,)", ofs);
// Resize up
reserve( m_size + 1 );
// Move following items up
#ifndef _LIBCXX_STRING_
#define _LIBCXX_STRING_
+#include "_libcxx_helpers.h"
#include <allocator>
namespace std {
}
};
+ allocator_type m_allocator;
+ dynamic_info *m_content;
+
public:
basic_string(const allocator_type& alloc = allocator_type()):
m_allocator(alloc),
{
*this = str;
}
+ #if _CXX11_AVAIL
+ basic_string(basic_string&& str):
+ m_allocator(str.m_allocator),
+ m_content(str.m_content)
+ {
+ str.m_content = 0;
+ ::_sys::debug("basic_string(move) %p %s", m_content, c_str());
+ }
+ #endif
basic_string(const basic_string& str, const allocator_type& alloc):
basic_string(str, 0, str.length(), alloc)
{
reserve(n);
for( size_type i = 0; i < n; i ++ )
m_content->m_data[i] = s[i];
+ m_content->m_data[n] = 0;
m_content->m_size = n;
}
}
reserve(n);
for( size_type i = 0; i < n; i ++ )
m_content->m_data[i] = c;
+ m_content->m_data[n] = 0;
m_content->m_size = n;
}
}
if( m_content->m_size < size ) {
for( size_type ofs = m_content->m_size; ofs < size; ofs ++ )
m_content->m_data[ofs] = c;
+ m_content->m_data[size] = 0;
}
m_content->m_size = size;
m_content->m_data[size] = 0;
// String operations
const char *c_str() const {
// TODO: this is const, but also might need to do processing
+ if(m_content) {
+ _libcxx_assert(m_content->m_data[m_content->m_size] == '\0');
+ }
return (m_content ? m_content->m_data : "");
}
const char *data() const {
static const size_type npos = -1;
private:
- allocator_type m_allocator;
- dynamic_info *m_content;
-
void own_content() {
if(!m_content)
{