-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* src/*: * tests/*: * HISTORY: * LICENSE: Updated to uSTL 1.6 sources.
- Loading branch information
sergeig
committed
Apr 4, 2012
1 parent
9f07124
commit 632d61f
Showing
99 changed files
with
453 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
2012-03-24 Sergei Gavrikov <[email protected]> | ||
|
||
* include/*: | ||
* src/*: | ||
* tests/*: | ||
* HISTORY: | ||
* LICENSE: Updated to uSTL 1.6 sources. | ||
|
||
2011-11-21 John Dallaway <[email protected]> | ||
|
||
* include/ustl/ustring.h: Fix incorrect behaviour of iat when passed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
The MIT License | ||
|
||
Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of this software and associated documentation files (the "Software"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef USTL_H_6A5A10410D2CD7FC2D78FE470F045EB7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2006-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2006 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef BKTRACE_H_63ABB1E4388CEDD975DBE58B57DE474F | ||
|
@@ -47,6 +47,4 @@ class CBacktrace { | |
|
||
} // namespace ustl | ||
|
||
ALIGNOF(ustl::CBacktrace, sizeof(void*)) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef CMEMLINK_H_7CFAB32C5C6732ED29B34EF00EA40A12 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef FSTREAM_H_056E10F70EAD416443E3B36A2D6B5FA3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef MEMBLOCK_H_7ED63A891164CC43578E63664D52A196 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef MEMLINK_H_798D25827C8E322D2D7E734B169FF5FC | ||
|
@@ -64,9 +64,6 @@ class memlink : public cmemlink { | |
inline void link (void* first, void* last) { link (first, distance (first, last)); } | ||
inline void relink (const void* p, size_type n) { cmemlink::relink (p, n); } | ||
inline void relink (void* p, size_type n) { cmemlink::relink (p, n); } | ||
inline void copy (const cmemlink& l) { copy (begin(), l.cdata(), l.size()); } | ||
inline void copy (const void* p, size_type n) { copy (begin(), p, n); } | ||
void copy (iterator offset, const void* p, size_type n); | ||
inline void swap (memlink& l) { cmemlink::swap (l); } | ||
void fill (iterator start, const void* p, size_type elsize, size_type elCount = 1); | ||
inline void insert (iterator start, size_type size); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
// | ||
/// \file metamac.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef MISTREAM_H_103AEF1F266C04AA1A817D38705983DA | ||
|
@@ -13,7 +13,7 @@ | |
#include "uios.h" | ||
#include "config.h" | ||
#if WANT_STREAM_BOUNDS_CHECKING | ||
#include <typeinfo> | ||
#include "typeinfo.h" | ||
#endif | ||
|
||
namespace ustl { | ||
|
@@ -257,7 +257,7 @@ inline void istream::align (streamsize grain) | |
template <typename T> | ||
inline void istream::iread (T& v) | ||
{ | ||
assert (aligned (alignof (v))); | ||
assert (aligned (stream_align_of (v))); | ||
#if WANT_STREAM_BOUNDS_CHECKING | ||
if (!verify_remaining ("read", USTL_TYPENAME(v), sizeof(T))) | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef MOSTREAM_H_24A8C5397E0848216573E5670930FC9A | ||
|
@@ -12,7 +12,7 @@ | |
#include "uios.h" | ||
#include "config.h" | ||
#if WANT_STREAM_BOUNDS_CHECKING | ||
#include <typeinfo> | ||
#include "typeinfo.h" | ||
#endif | ||
|
||
namespace ustl { | ||
|
@@ -28,7 +28,7 @@ class string; | |
/// This class contains a set of functions to write integral types into an | ||
/// unstructured memory block. Packing binary file data can be done this | ||
/// way, for instance. aligning the data is your responsibility, and can | ||
/// be accomplished by proper ordering of writes and by calling \ref ostream::align. | ||
/// be accomplished by proper ordering of writes and by calling align. | ||
/// Unaligned access is usually slower by orders of magnitude and, | ||
/// on some architectures, such as PowerPC, can cause your program to crash. | ||
/// Therefore, all write functions have asserts to check alignment. | ||
|
@@ -253,7 +253,7 @@ inline void ostream::write (const cmemlink& buf) | |
template <typename T> | ||
inline void ostream::iwrite (const T& v) | ||
{ | ||
assert (aligned (alignof (v))); | ||
assert (aligned (stream_align_of (v))); | ||
#if WANT_STREAM_BOUNDS_CHECKING | ||
if (!verify_remaining ("write", USTL_TYPENAME(v), sizeof(T))) | ||
return; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef FDOSTREAM_H_5E27FC3D530BF3CA04D6C73F5700EECC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
// | ||
/// \file simd.h | ||
|
@@ -54,7 +54,7 @@ inline void packop (const Ctr& op1, const Ctr& op2, Ctr& result, BinaryOperation | |
{ | ||
assert (op1.size() <= op2.size() && op1.size() <= result.size()); | ||
passign (op1, result); | ||
packop (op2, result); | ||
op (op2, result); | ||
} | ||
|
||
/// Copies \p op1 into \p result. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef SISTREAM_H_0CCA102229A49F5D65EE852E62B27CE2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef SOSTREAM_H_5323DC8C26E181D43278F2F53FDCF19F | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
// | ||
/// \file strmsize.h | ||
|
@@ -28,6 +28,20 @@ inline streamsize stream_size_of (const T& v) { | |
return (stream_sizer_t()(v)); | ||
} | ||
|
||
/// \brief Returns the recommended stream alignment for type \p T. Override with ALIGNOF. | ||
/// Because this is occasionally called with a null value, do not access the argument! | ||
template <typename T> | ||
inline size_t stream_align_of (const T&) | ||
{ | ||
if (numeric_limits<T>::is_integral) | ||
return (__alignof__(T)); | ||
return (4); | ||
} | ||
|
||
#define ALIGNOF(type,grain) \ | ||
namespace ustl { \ | ||
template <> inline size_t stream_align_of (const type&) { return (grain); } } | ||
|
||
} // namespace ustl | ||
|
||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2007-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2007 by Mike Sharov <[email protected]> | ||
// | ||
// This implementation is adapted from the Loki library, distributed under | ||
// the MIT license with Copyright (c) 2001 by Andrei Alexandrescu. | ||
|
40 changes: 40 additions & 0 deletions
40
packages/language/cxx/ustl/current/include/ustl/typeinfo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
// | ||
#ifndef TYPEINFO_H_E67A267F0BBB5005 | ||
#define TYPEINFO_H_E67A267F0BBB5005 | ||
|
||
#ifndef WITHOUT_LIBSTDCPP | ||
#include <typeinfo> | ||
#else | ||
|
||
#include "uexception.h" | ||
|
||
namespace __cxxabiv1 { class __class_type_info; } | ||
|
||
namespace std { | ||
class type_info { | ||
public: | ||
inline virtual ~type_info (void) { } | ||
inline const char* name (void) const { return (__name[0] == '*' ? __name + 1 : __name); } | ||
inline bool before (const type_info& v) const { return (__name < v.__name); } | ||
inline bool operator==(const type_info& v) const { return (__name == v.__name); } | ||
inline bool operator!=(const type_info& v) const { return (!operator==(v)); } | ||
virtual bool __is_pointer_p (void) const; | ||
virtual bool __is_function_p (void) const; | ||
virtual bool __do_catch (const type_info* __thr_type, void** __thr_obj, unsigned __outer) const; | ||
virtual bool __do_upcast (const __cxxabiv1::__class_type_info* __target, void** __obj_ptr) const; | ||
explicit inline type_info (const char* newname) : __name(newname) { } | ||
private: | ||
inline void operator= (const type_info&) { } | ||
inline type_info (const type_info&) { } | ||
protected: | ||
const char* __name; | ||
}; | ||
|
||
} // namespace std | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2007-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2007 by Mike Sharov <[email protected]> | ||
// | ||
// This implementation is adapted from the Loki library, distributed under | ||
// the MIT license with Copyright (c) 2001 by Andrei Alexandrescu. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2007-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2007 by Mike Sharov <[email protected]> | ||
// | ||
// This implementation is adapted from the Loki library, distributed under | ||
// the MIT license with Copyright (c) 2001 by Andrei Alexandrescu. | ||
|
@@ -38,7 +38,8 @@ struct IsSameType<T,T> { enum { value = true }; }; | |
/// Conversion<T,U>::exists2Way is true if U is also convertible to T | ||
/// Conversion<T,U>::sameType is true if U is T | ||
template <typename T, typename U> | ||
class Conversion { | ||
struct Conversion { | ||
private: | ||
typedef char UT; | ||
typedef short TT; | ||
static UT Test (U); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef UALGO_H_711AB4214D417A51166694D47A662D6E | ||
|
@@ -9,7 +9,6 @@ | |
#include "upair.h" | ||
#include "ualgobase.h" | ||
#include "ufunction.h" | ||
#include "upredalgo.h" | ||
#include "umemory.h" | ||
#include <stdlib.h> // for rand() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// This file is part of the uSTL library, an STL implementation. | ||
// | ||
// Copyright (c) 2005-2009 by Mike Sharov <[email protected]> | ||
// Copyright (c) 2005 by Mike Sharov <[email protected]> | ||
// This file is free software, distributed under the MIT License. | ||
|
||
#ifndef UALGOBASE_H_683A0BE77546133C4CE0E3622CFAA2EB | ||
|
@@ -258,7 +258,7 @@ COPY_BACKWARD_ALIAS_FUNC(const void, void, uint8_t) | |
#undef COPY_BACKWARD_ALIAS_FUNC | ||
#define FILL_ALIAS_FUNC(type, alias_type, v_type) \ | ||
template <> inline void fill (type* first, type* last, const v_type& value) \ | ||
{ fill ((alias_type*) first, (alias_type*) last, (const alias_type&) value); } | ||
{ fill ((alias_type*) first, (alias_type*) last, (const alias_type) value); } | ||
FILL_ALIAS_FUNC(void, uint8_t, char) | ||
FILL_ALIAS_FUNC(void, uint8_t, uint8_t) | ||
#if WANT_UNROLLED_COPY | ||
|
@@ -298,7 +298,7 @@ COPY_N_ALIAS_FUNC(const int32_t, int32_t, uint32_t) | |
#undef COPY_N_ALIAS_FUNC | ||
#define FILL_N_ALIAS_FUNC(type, alias_type, v_type) \ | ||
template <> inline type* fill_n (type* first, size_t n, const v_type& value) \ | ||
{ return ((type*) fill_n ((alias_type*) first, n, (const alias_type&) value)); } | ||
{ return ((type*) fill_n ((alias_type*) first, n, (const alias_type) value)); } | ||
FILL_N_ALIAS_FUNC(void, uint8_t, char) | ||
FILL_N_ALIAS_FUNC(void, uint8_t, uint8_t) | ||
#if WANT_UNROLLED_COPY | ||
|
Oops, something went wrong.