namespace axl::sl

namespace sl {

// typedefs

typedef CmpSzBase<char> CmpSz;
typedef CmpSzBase<wchar_t> CmpSz_w;
typedef CmpSzBase_i<char> CmpSz_i;
typedef CmpSzBase_i<wchar_t> CmpSz_wi;
typedef HashSzBase<char> HashSz;
typedef HashSzBase<wchar_t> HashSz_w;
typedef HashSzBase<utf8_t> HashSz_utf8;
typedef HashSzBase<utf16_t> HashSz_utf16;
typedef HashSzBase<utf32_t> HashSz_utf32;
typedef HashSzBase_i<char> HashSz_i;
typedef HashSzBase_i<wchar_t> HashSz_i_w;
typedef HashSzBase_i<utf8_t> HashSz_i_utf8;
typedef HashSzBase_i<utf16_t> HashSz_i_utf16;
typedef HashSzBase_i<utf32_t> HashSz_i_utf32;
typedef PackStringBase<char> PackString;
typedef PackStringBase<wchar_t> PackString_w;
typedef PackStringBase<utf8_t> PackString_utf8;
typedef PackStringBase<utf16_t> PackString_utf16;
typedef PackStringBase<utf32_t> PackString_utf32;
typedef StringRefBase<char> StringRef;
typedef StringRefBase<wchar_t> StringRef_w;
typedef StringRefBase<utf8_t> StringRef_utf8;
typedef StringRefBase<utf16_t> StringRef_utf16;
typedef StringRefBase<utf32_t> StringRef_utf32;
typedef StringBase<char> String;
typedef StringBase<wchar_t> String_w;
typedef StringBase<utf8_t> String_utf8;
typedef StringBase<utf16_t> String_utf16;
typedef StringBase<utf32_t> String_utf32;
typedef StringDetailsBase<char> StringDetails;
typedef StringDetailsBase<wchar_t> StringDetails_w;
typedef StringDetailsBase<utf8_t> StringDetails_utf8;
typedef StringDetailsBase<utf16_t> StringDetails_utf16;
typedef StringDetailsBase<utf32_t> StringDetails_utf32;
typedef EqStringIgnoreCaseBase_pcu<char> EqStringIgnoreCase_pcu;
typedef EqStringIgnoreCaseBase_pcu<wchar_t> EqStringIgnoreCase_pcu_w;
typedef EqStringIgnoreCaseBase_pcu<utf8_t> EqStringIgnoreCase_pcu_utf8;
typedef EqStringIgnoreCaseBase_pcu<utf16_t> EqStringIgnoreCase_pcu_utf16;
typedef EqStringIgnoreCaseBase_pcu<utf32_t> EqStringIgnoreCase_pcu_utf32;
typedef EqStringIgnoreCaseBase_pcp<char> EqStringIgnoreCase_pcp;
typedef EqStringIgnoreCaseBase_pcp<wchar_t> EqStringIgnoreCase_pcp_w;
typedef EqStringIgnoreCaseBase_pcp<utf8_t> EqStringIgnoreCase_pcp_utf8;
typedef EqStringIgnoreCaseBase_pcp<utf16_t> EqStringIgnoreCase_pcp_utf16;
typedef EqStringIgnoreCaseBase_pcp<utf32_t> EqStringIgnoreCase_pcp_utf32;
typedef HashStringIgnoreCaseBase_pcu<char> HashStringIgnoreCase_pcu;
typedef HashStringIgnoreCaseBase_pcu<wchar_t> HashStringIgnoreCase_pcu_w;
typedef HashStringIgnoreCaseBase_pcu<utf8_t> HashStringIgnoreCase_pcu_utf8;
typedef HashStringIgnoreCaseBase_pcu<utf16_t> HashStringIgnoreCase_pcu_utf16;
typedef HashStringIgnoreCaseBase_pcu<utf32_t> HashStringIgnoreCase_pcu_utf32;
typedef HashStringIgnoreCaseBase_pcp<char> HashStringIgnoreCase_pcp;
typedef HashStringIgnoreCaseBase_pcp<wchar_t> HashStringIgnoreCase_pcp_w;
typedef HashStringIgnoreCaseBase_pcp<utf8_t> HashStringIgnoreCase_pcp_utf8;
typedef HashStringIgnoreCaseBase_pcp<utf16_t> HashStringIgnoreCase_pcp_utf16;
typedef HashStringIgnoreCaseBase_pcp<utf32_t> HashStringIgnoreCase_pcp_utf32;
typedef UnpackStringBase<char> UnpackString;
typedef UnpackStringBase<wchar_t> UnpackString_w;
typedef UnpackStringBase<utf8_t> UnpackString_utf8;
typedef UnpackStringBase<utf16_t> UnpackString_utf16;
typedef UnpackStringBase<utf32_t> UnpackString_utf32;

// enums

enum BinTreeFindRelOp;
enum BitOpKind;
enum BoyerMooreFlag;
enum CaseConvertMethod;
enum GuidStringFlag;
enum RbColor;
enum TextBoyerMooreFlag;

// structs

template <
    typename T,
    typename Key,
    typename Value
    >
struct BinTreeNodeBase;

struct Guid;

template <
    typename Key,
    typename Value
    >
struct HashTableEntry;

template <typename T>
struct ListData;

struct ListLink;

template <
    typename Key,
    typename Value
    >
struct MapEntry;

struct ProtoMsg;

template <typename T>
struct ProtoMsg_1;

template <
    typename T1,
    typename T2
    >
struct ProtoMsg_2;

template <
    typename T1,
    typename T2,
    typename T3
    >
struct ProtoMsg_3;

template <
    typename T1,
    typename T2,
    typename T3,
    typename T4
    >
struct ProtoMsg_4;

struct SwitchInfo;

// classes

class AbstractProtoPeer;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Add;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class And;

template <typename T>
class ArgType<T*>;

template <>
class ArgType<uint16_t>;

template <>
class ArgType<uint32_t>;

template <>
class ArgType<uint64_t>;

template <>
class ArgType<uint8_t>;

template <>
class ArgType<String_utf32>;

template <>
class ArgType<wchar_t>;

template <>
class ArgType<String_utf16>;

template <>
class ArgType<String_utf8>;

template <>
class ArgType<int64_t>;

template <>
class ArgType<double>;

template <>
class ArgType<char>;

template <>
class ArgType<int8_t>;

template <>
class ArgType<float>;

template <typename T>
class ArgType;

template <>
class ArgType<int32_t>;

template <>
class ArgType<int16_t>;

template <
    typename T,
    typename Details0 = ArrayDetails<T>
    >
class Array;

template <>
class ArrayDetails<uint32_t>;

template <typename T>
class ArrayDetails<T*>;

template <>
class ArrayDetails<uint64_t>;

template <>
class ArrayDetails<uint8_t>;

template <>
class ArrayDetails<int8_t>;

template <>
class ArrayDetails<wchar_t>;

template <>
class ArrayDetails<int64_t>;

template <>
class ArrayDetails<uint16_t>;

template <>
class ArrayDetails<int16_t>;

template <>
class ArrayDetails<double>;

template <>
class ArrayDetails<char>;

template <>
class ArrayDetails<float>;

template <>
class ArrayDetails<int32_t>;

template <typename T>
class ArrayDetails;

template <
    typename T,
    typename Details0 = ArrayDetails<T>
    >
class ArrayRef;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Assign;

template <
    typename T,
    typename Arg = T
    >
class AssignClosure_L;

template <
    typename T,
    typename Arg = T
    >
class AssignClosure_R;

template <
    typename T,
    typename Delete0 = typename mem::StdDelete<T>
    >
class AutoPtrArray;

template <
    typename T,
    typename GetLink = ImplicitPtrCast<T, ListLink>
    >
class AuxList;

template <
    typename Func,
    typename Result,
    typename Arg,
    typename ArgSave = Arg
    >
class BinClosure_1;

template <
    typename Func,
    typename Result,
    typename Arg,
    typename ArgSave = Arg
    >
class BinClosure_2;

template <
    typename T,
    typename Node,
    typename Key,
    typename Value,
    typename Cmp,
    typename KeyArg,
    typename ValueArg
    >
class BinTreeBase;

class BinaryBoyerMooreFind;
class BitMap;

template <size_t bitCount>
class BitMapN;

class BmhFind;

template <typename T>
class BoxIterator;

template <
    typename T,
    typename Value,
    typename Entry,
    typename Link
    >
class BoxIteratorImpl;

template <
    typename T,
    typename ValueArg = typename ArgType<T>::Type
    >
class BoxList;

template <typename T>
class BoxListEntry;

template <typename T>
class BoyerMooreFindBase;

template <typename T>
class BoyerMooreIncrementalContext;

class BuddyAllocMap;
class CircularBuffer;

template <
    typename T,
    typename SwitchTable
    >
class CmdLineParser;

class CmdLineParserRoot;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Cmp;

template <typename T>
class CmpBin;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class CmpDuckType;

template <typename T>
class CmpDuckTypePtr;

template <
    typename T,
    typename C
    >
class CmpPtr;

template <>
class CmpSzBase<wchar_t>;

template <>
class CmpSzBase<char>;

template <typename T>
class CmpSzBase;

template <>
class CmpSzBase_i<char>;

template <>
class CmpSzBase_i<wchar_t>;

template <typename T>
class CmpSzBase_i;

template <
    typename T,
    typename Compare
    >
class CompareBoxListEntry;

template <
    typename Key,
    typename Value,
    typename Compare
    >
class CompareMapEntryKey;

template <
    typename Key,
    typename Value,
    typename Compare
    >
class CompareMapEntryValue;

template <typename T>
class ConstBoxIterator;

template <typename T>
class ConstBoxList;

template <typename T>
class ConstHandleTableIterator;

template <
    typename Key,
    typename Value
    >
class ConstHandleTableIteratorBase;

template <
    typename Key,
    typename Value
    >
class ConstHashTableIterator;

template <
    typename T,
    typename GetLink = ImplicitPtrCast<T, ListLink>
    >
class ConstIterator;

template <
    typename T,
    typename GetLink = ImplicitPtrCast<T, ListLink>
    >
class ConstList;

template <
    typename T,
    typename GetLink0,
    typename Iterator0
    >
class ConstListBase;

template <
    typename Key,
    typename Value
    >
class ConstMapIterator;

template <typename Value>
class ConstStringHashTableIterator;

template <typename Value>
class ConstStringHashTableIterator_utf16;

template <typename Value>
class ConstStringHashTableIterator_utf32;

template <typename Value>
class ConstStringHashTableIterator_utf8;

template <typename Value>
class ConstStringHashTableIterator_w;

template <typename T>
class Construct;

template <class T>
class ConstructSimpleSingleton;

template <class T>
class ConstructSingleton;

template <
    typename T,
    typename GetLink = ImplicitPtrCast<T, ListLink>
    >
class CppList;

template <typename T>
class Destruct;

template <class T>
class DestructSingleton;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Div;

template <
    typename Key,
    typename Value,
    typename KeyArg = typename ArgType<Key>::Type,
    typename ValueArg = typename ArgType<Value>::Type
    >
class DuckTypeHashTable;

template <
    typename Key,
    typename Value,
    typename ValueArg = typename ArgType<Value>::Type
    >
class DuckTypePtrHashTable;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Eq;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class EqBin;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class EqDuckType;

template <typename T>
class EqDuckTypePtr;

template <typename T>
class EqStringIgnoreCaseBase_pcp;

template <typename T>
class EqStringIgnoreCaseBase_pcu;

template <
    typename A,
    typename B
    >
class ExplicitCast;

template <
    typename A,
    typename B
    >
class ExplicitPtrCast;

template <typename T>
class False;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Ge;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Gt;

template <
    typename T,
    typename Close = Void<T>,
    typename GetInvalidHandle = Zero<T>
    >
class Handle;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class HandleTable;

template <
    typename Key,
    typename Value,
    typename ValueArg = typename ArgType<Value>::Type
    >
class HandleTableBase;

template <typename T>
class HandleTableIterator;

template <
    typename Key,
    typename Value
    >
class HandleTableIteratorBase;

template <typename T>
class HashChecksum16;

template <typename T>
class HashDjb2;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class HashDuckType;

template <typename T>
class HashId;

template <
    typename T,
    typename H
    >
class HashPtr;

template <typename T>
class HashStringIgnoreCaseBase_pcp;

template <typename T>
class HashStringIgnoreCaseBase_pcu;

template <>
class HashSzBase<char>;

template <>
class HashSzBase<wchar_t>;

template <typename T>
class HashSzBase;

template <>
class HashSzBase_i<char>;

template <typename T>
class HashSzBase_i;

template <>
class HashSzBase_i<wchar_t>;

template <
    typename Key,
    typename Value,
    typename Hash,
    typename Eq = Eq<Key>,
    typename KeyArg = typename ArgType<Key>::Type,
    typename ValueArg = typename ArgType<Value>::Type
    >
class HashTable;

template <
    typename Key,
    typename Value
    >
class HashTableIterator;

template <
    typename A,
    typename B
    >
class ImplicitCast;

template <
    typename A,
    typename B
    >
class ImplicitPtrCast;

class InitCharCodeTable;
class InitCharLiteralTable;

template <
    typename T,
    typename GetLink = ImplicitPtrCast<T, ListLink>
    >
class Iterator;

template <
    typename T,
    typename Entry0,
    typename Link0,
    typename GetLink0
    >
class IteratorBase;

template <
    typename T,
    typename Entry,
    typename Link,
    typename GetLink = ImplicitPtrCast<T, ListLink>
    >
class IteratorImpl;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Le;

template <typename T>
class LegacyPacketizer;

class LegacyPacketizerRoot;

template <
    typename T,
    typename GetLink = ImplicitPtrCast<T, ListLink>,
    typename Delete = mem::StdDelete<T>
    >
class List;

template <
    typename T,
    typename GetLink0,
    typename Iterator0,
    typename ConstIterator0
    >
class ListBase;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Lt;

template <
    typename Key,
    typename Value
    >
class MapIterator;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Max;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Min;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Minus;

template <typename T>
class MinusOne;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Mod;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Mul;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Ne;

template <typename T>
class NoOp;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Not;

template <
    typename A,
    typename B,
    size_t offset
    >
class Offset;

template <
    typename C,
    typename B
    >
class OffsetOf;

template <
    typename Func,
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class OpAssign;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Or;

template <
    typename T,
    typename GetLink,
    typename Iterator,
    typename ConstIterator,
    typename Delete0
    >
class OwningListBase;

template <typename T>
class Pack<T*>;

template <>
class Pack<uint16_t>;

template <>
class Pack<uint8_t>;

template <>
class Pack<wchar_t*>;

template <>
class Pack<wchar_t>;

template <>
class Pack<int16_t>;

template <>
class Pack<err::ErrorHdr*>;

template <>
class Pack<int8_t>;

template <>
class Pack<const wchar_t*>;

template <>
class Pack<char*>;

template <typename T>
class Pack;

template <>
class Pack<char>;

template <>
class Pack<const err::ErrorHdr*>;

template <>
class Pack<const char*>;

template <typename T>
class PackIntTrunc;

class PackLastError;
class PackPtrSize;

template <
    typename T,
    typename SizeOf = sl::SizeOf<T>
    >
class PackSelfSizedPtr;

template <
    typename Pack1,
    typename Pack2
    >
class PackSeqEx;

template <
    typename Pack1,
    typename Pack2
    >
class PackSeqEx_2;

template <
    typename Pack1,
    typename Pack2,
    typename Pack3
    >
class PackSeqEx_3;

template <
    typename Pack1,
    typename Pack2,
    typename Pack3,
    typename Pack4
    >
class PackSeqEx_4;

template <
    typename Pack1,
    typename Pack2,
    typename Pack3,
    typename Pack4,
    typename Pack5
    >
class PackSeqEx_5;

template <
    typename Pack1,
    typename Pack2,
    typename Pack3,
    typename Pack4,
    typename Pack5,
    typename Pack6
    >
class PackSeqEx_6;

template <
    typename T1,
    typename T2
    >
class PackSeq_2;

template <
    typename T1,
    typename T2,
    typename T3
    >
class PackSeq_3;

template <
    typename T1,
    typename T2,
    typename T3,
    typename T4
    >
class PackSeq_4;

template <
    typename T1,
    typename T2,
    typename T3,
    typename T4,
    typename T5
    >
class PackSeq_5;

template <
    typename T1,
    typename T2,
    typename T3,
    typename T4,
    typename T5,
    typename T6
    >
class PackSeq_6;

template <typename T>
class PackStringBase;

class Package;
class Packer;

template <typename Pack>
class PackerImpl;

class PackerSeq;

template <typename T>
class Packetizer;

class PacketizerRoot;

template <typename T>
class ProtoPeer;

template <
    typename Key,
    typename Value,
    typename Cmp = Cmp<Key>,
    typename KeyArg = typename ArgType<Key>::Type,
    typename ValueArg = typename ArgType<Value>::Type
    >
class RbTree;

template <
    typename Key,
    typename Value
    >
class RbTreeIterator;

template <
    typename Key,
    typename Value
    >
class RbTreeNode;

template <typename T>
class ReverseArray;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Shl;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Shr;

template <typename T>
class SimpleArgType;

template <typename T>
class SimpleArrayDetails;

template <
    typename Key,
    typename Value,
    typename KeyArg = typename ArgType<Key>::Type,
    typename ValueArg = typename ArgType<Value>::Type
    >
class SimpleHashTable;

template <typename T>
class SizeOf;

template <typename T>
class SizeOfNoReusableTailPadding;

template <typename T>
class StdArrayList;

template <
    typename T,
    typename Details0 = StringDetailsBase<T>
    >
class StringBase;

template <>
class StringDetailsBase<utf8_t>;

template <>
class StringDetailsBase<utf32_t>;

template <>
class StringDetailsBase<utf16_t>;

template <typename T>
class StringDetailsBase;

template <typename T>
class StringDetailsImpl;

template <typename Value>
class StringHashTable;

template <typename Value>
class StringHashTableIgnoreCase_pcp;

template <typename Value>
class StringHashTableIgnoreCase_pcp_utf16;

template <typename Value>
class StringHashTableIgnoreCase_pcp_utf32;

template <typename Value>
class StringHashTableIgnoreCase_pcp_utf8;

template <typename Value>
class StringHashTableIgnoreCase_pcp_w;

template <typename Value>
class StringHashTableIgnoreCase_pcu;

template <typename Value>
class StringHashTableIgnoreCase_pcu_utf16;

template <typename Value>
class StringHashTableIgnoreCase_pcu_utf32;

template <typename Value>
class StringHashTableIgnoreCase_pcu_utf8;

template <typename Value>
class StringHashTableIgnoreCase_pcu_w;

template <typename Value>
class StringHashTableIterator;

template <typename Value>
class StringHashTableIterator_utf16;

template <typename Value>
class StringHashTableIterator_utf32;

template <typename Value>
class StringHashTableIterator_utf8;

template <typename Value>
class StringHashTableIterator_w;

template <typename Value>
class StringHashTable_utf16;

template <typename Value>
class StringHashTable_utf32;

template <typename Value>
class StringHashTable_utf8;

template <typename Value>
class StringHashTable_w;

template <
    typename T,
    typename Details0 = StringDetailsBase<T>
    >
class StringRefBase;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Sub;

template <typename T>
class Swap;

class TextBoyerMooreFind;

template <typename T>
class True;

template <>
class Unpack<err::ErrorHdr*>;

template <typename T>
class Unpack<T*>;

template <>
class Unpack<wchar_t*>;

template <>
class Unpack<const wchar_t*>;

template <>
class Unpack<const err::ErrorHdr*>;

template <>
class Unpack<const char*>;

template <>
class Unpack<char*>;

template <typename T>
class Unpack;

template <typename T>
class UnpackPtr;

template <
    typename T,
    typename SizeOf = sl::SizeOf<T>
    >
class UnpackSelfSizedPtr;

template <typename T>
class UnpackStringBase;

class Unpacker;

template <typename T>
class Void;

template <
    typename T,
    typename Arg = typename ArgType<T>::Type
    >
class Xor;

template <typename T>
class Zero;

// global variables

AXL_SELECT_ANY const axl::sl::Guid g_nullGuid =   { { {  0x0 ,  0x0 ,  0x0 , {  0x0 ,  0x0 ,  0x0 ,  0x0 ,  0x0 ,  0x0 ,  0x0 ,  0x0  } } } };
AXL_SELECT_ANY ListLink g_nullListLink;

// global functions

uint8_t
geLoBit8(uint8_t x);

uint16_t
getLoBit16(uint16_t x);

uint32_t
getLoBit32(uint32_t x);

uint64_t
getLoBit64(uint64_t x);

uint8_t
getHiBit8(uint8_t x);

uint16_t
getHiBit16(uint16_t x);

uint32_t
getHiBit32(uint32_t x);

uint64_t
getHiBit64(uint64_t x);

uint8_t
getPowerOf2Ge8(uint8_t x);

uint16_t
getPowerOf2Ge16(uint16_t x);

uint32_t
getPowerOf2Ge32(uint32_t x);

uint64_t
getPowerOf2Ge64(uint64_t x);

uint8_t
getLoBitIdx8(uint8_t x);

uint8_t
getLoBitIdx16(uint16_t x);

uint8_t
getLoBitIdx32(uint32_t x);

uint8_t
getLoBitIdx64(uint64_t x);

uint8_t
getHiBitIdx8(uint8_t x);

uint8_t
getHiBitIdx16(uint16_t x);

uint8_t
getHiBitIdx32(uint32_t x);

uint8_t
getHiBitIdx64(uint64_t x);

uint8_t
getLoBitmask8(size_t to);

uint8_t
getHiBitmask8(size_t from);

uint8_t
getBitmask8(
    size_t from,
    size_t to
    );

uint16_t
getLoBitmask16(size_t to);

uint16_t
getHiBitmask16(size_t from);

uint16_t
getBitmask16(
    size_t from,
    size_t to
    );

uint32_t
getLoBitmask32(size_t to);

uint32_t
getHiBitmask32(size_t from);

uint32_t
getBitmask32(
    size_t from,
    size_t to
    );

uint64_t
getLoBitmask64(size_t to);

uint64_t
getHiBitmask64(size_t from);

uint64_t
getBitmask64(
    size_t from,
    size_t to
    );

template <typename T>
bool
isPowerOf2(T x);

template <typename T>
bool
isAligned(
    T x,
    size_t factor
    );

template <
    size_t factor,
    typename T
    >
bool
isAligned(T x);

template <typename T>
T
align(
    T x,
    size_t factor
    );

template <
    size_t factor,
    typename T
    >
T
align(T x);

template <size_t growLimit>
size_t
getAllocSize(size_t size);

bool
getBit(
    const size_t* map,
    size_t pageCount,
    size_t bit
    );

bool
setBit(
    size_t* map,
    size_t pageCount,
    size_t bit,
    bool value = true
    );

bool
setBitRange(
    size_t* map,
    size_t pageCount,
    size_t from,
    size_t to,
    bool value = true
    );

bool
mergeBitMaps(
    size_t* map,
    const size_t* map2,
    size_t pageCount,
    BitOpKind op
    );

void
inverseBitMap(
    size_t* map,
    size_t pageCount
    );

size_t
findBit(
    const size_t* map,
    size_t pageCount,
    size_t from,
    bool value = true
    );

uint16_t
swapByteOrder16(uint16_t value);

uint32_t
swapByteOrder32(uint32_t value);

uint64_t
swapByteOrder64(uint64_t value);

void
swapByteOrder(
    void* dst,
    const void* src,
    size_t size
    );

template <
    typename Functor,
    typename Argument
    >
void
callOnce(
    Functor functor,
    Argument argument,
    volatile int32_t* flag = NULL
    );

const char*
getCharLiteral(uchar_t c);

const char*
getCharCodeLiteral(uchar_t c);

String
getCmdLineHelpString(const ConstList<SwitchInfo>& switchInfoList);

template <typename T>
void
construct(T* p);

template <
    typename T,
    typename Arg
    >
void
construct(
    T* p,
    Arg arg
    );

template <
    typename T,
    typename Arg1,
    typename Arg2
    >
void
construct(
    T* p,
    Arg1 arg1,
    Arg2 arg2
    );

template <
    typename T,
    typename Arg1,
    typename Arg2,
    typename Arg3
    >
void
construct(
    T* p,
    Arg1 arg1,
    Arg2 arg2,
    Arg3 arg3
    );

template <
    typename T,
    typename Arg1,
    typename Arg2,
    typename Arg3,
    typename Arg4
    >
void
construct(
    T* p,
    Arg1 arg1,
    Arg2 arg2,
    Arg3 arg3,
    Arg4 arg4
    );

template <typename T>
void
destruct(T* p);

template <typename T>
void
takeOver(
    T* dst,
    T* src
    );

template <
    typename T,
    typename Action
    >
void
loopArray(
    T* p,
    size_t count,
    Action action
    );

template <
    typename Iterator,
    typename Action
    >
void
loopIterator(
    Iterator it,
    Action action
    );

template <
    typename T,
    typename Filter,
    typename Action
    >
size_t
filteredLoopArray(
    T* p,
    size_t count,
    Filter filter,
    Action action
    );

template <
    typename Iterator,
    typename Filter,
    typename Action
    >
size_t
filteredLoopIterator(
    Iterator it,
    Filter filter,
    Action action
    );

Guid
buildGuid(
    uint32_t l,
    uint16_t s1,
    uint16_t s2,
    uint8_t b1,
    uint8_t b2,
    uint8_t b3,
    uint8_t b4,
    uint8_t b5,
    uint8_t b6,
    uint8_t b7,
    uint8_t b8
    );

Guid
parseGuid(const sl::StringRef& string);

Guid
generateGuid();

size_t
djb2();

size_t
djb2(
    size_t hash,
    const void* p0,
    size_t size
    );

size_t
djb2(
    const void* p,
    size_t size
    );

template <typename O>
size_t
djb2_op(
    O op,
    size_t hash,
    const utf8_t* p,
    size_t length
    );

template <typename O>
size_t
djb2_op(
    O op,
    size_t hash,
    const utf16_t* p,
    size_t length
    );

template <typename O>
size_t
djb2_op(
    O op,
    size_t hash,
    const utf32_t* p,
    size_t length
    );

template <
    typename T,
    typename O
    >
size_t
djb2_op(
    O op,
    size_t hash,
    const T* p,
    size_t length
    );

template <
    typename T,
    typename O
    >
size_t
djb2_op(
    O op,
    const T* p,
    size_t length
    );

uint16_t
checksum16(
    const void* p,
    size_t size
    );

const void*
memMem(
    const void* p1,
    size_t size1,
    const void* p2,
    size_t size2
    );

void*
memMem(
    void* p1,
    size_t size1,
    const void* p2,
    size_t size2
    );

const void*
reverseMemMem(
    const void* p1,
    size_t size1,
    const void* p2,
    size_t size2
    );

void*
reverseMemMem(
    void* p1,
    size_t size1,
    const void* p2,
    size_t size2
    );

template <typename T>
rc::Ptr<mem::Block>
createPackage_va(axl_va_list va);

template <typename T>
rc::Ptr<mem::Block>
createPackage(
    int unused,
    ...
    );

rc::Ptr<mem::Block>
formatPackage_va(
    const char* formatString,
    axl_va_list va
    );

rc::Ptr<mem::Block>
formatPackage(
    const char* formatString,
    ...
    );

template <typename T>
T*
getSimpleSingleton(volatile int32_t* flag = NULL);

template <typename T>
T*
getSingleton(volatile int32_t* flag = NULL);

template <typename C>
StringBase<C>
operator+(
    const char* p,
    const StringRefBase<C>& src
    );

template <typename C>
StringBase<C>
operator+(
    const wchar_t* p,
    const StringRefBase<C>& src
    );

template <typename C>
StringBase<C>
operator+(
    char c,
    const StringRefBase<C>& src
    );

template <typename C>
StringBase<C>
operator+(
    wchar_t c,
    const StringRefBase<C>& src
    );

String
formatString_va(
    const char* formatString,
    axl_va_list va
    );

String
formatString(
    const char* formatString,
    ...
    );

String_w
formatString_w_va(
    const wchar_t* formatString,
    axl_va_list va
    );

String_w
formatString_w(
    const wchar_t* formatString,
    ...
    );

template <typename T>
void
swap(
    T* a,
    T* b
    );

} // namespace sl