2010-05-11 19:42:16 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2010-05-11 21:36:01 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-11 19:42:16 +00:00
|
|
|
//
|
2010-11-16 22:09:02 +00:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-11 19:42:16 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <string>
|
|
|
|
|
|
|
|
// const_iterator cbegin() const;
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <cassert>
|
|
|
|
|
2013-06-28 16:59:19 +00:00
|
|
|
#include "../min_allocator.h"
|
|
|
|
|
2010-05-11 19:42:16 +00:00
|
|
|
template <class S>
|
|
|
|
void
|
|
|
|
test(const S& s)
|
|
|
|
{
|
|
|
|
typename S::const_iterator cb = s.cbegin();
|
|
|
|
if (!s.empty())
|
|
|
|
{
|
|
|
|
assert(*cb == s[0]);
|
|
|
|
}
|
|
|
|
assert(cb == s.begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2013-06-28 16:59:19 +00:00
|
|
|
{
|
2010-05-11 19:42:16 +00:00
|
|
|
typedef std::string S;
|
|
|
|
test(S());
|
|
|
|
test(S("123"));
|
2013-06-28 16:59:19 +00:00
|
|
|
}
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
{
|
|
|
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
|
|
|
test(S());
|
|
|
|
test(S("123"));
|
|
|
|
}
|
|
|
|
#endif
|
2010-05-11 19:42:16 +00:00
|
|
|
}
|