Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions
23.bitset.cpp File Reference
#include <bitset>
#include <istream>
#include <ostream>
#include <cstdio>
#include <climits>
#include <rw_char.h>
#include <rw_rand.h>
#include <rw_driver.h>
Include dependency graph for 23.bitset.cpp:

Go to the source code of this file.

Data Structures

struct  test_set< N >
 
struct  has_implicit_ctor
 
struct  MyAlloc< charT >
 

Macros

#define NLOOPS   128
 
#define MEMFUN(result, name, arg_list)
 
#define MEMFUN(result, name, arg_list)
 
#define PARAMLIST_3(T)   T, std::char_traits<T>, std::allocator<T>
 
#define PARAMLIST_2(T)   T, std::char_traits<T>
 
#define FUN(result, name, arg_list)
 
#define PARAMLIST(T)   T, std::char_traits<T>
 
#define TEST_OP(op)
 
#define TO_STR(s)   narrow_string (s).c_str ()
 
#define DO_TEST(N)   run_test ((std::bitset<N>*)0)
 

Functions

std::size_t bitmax (std::size_t n)
 
void is_explicit (const std::bitset< 0 > &)
 
template<std::size_t N>
void test_ctors (const std::bitset< N > *)
 
template<std::size_t N>
void stress_ctors (const std::bitset< N > *)
 
template<std::size_t N>
void test_operators (const std::bitset< N > *)
 
template<std::size_t N>
void test_other (const std::bitset< N > *)
 
template<std::size_t N>
void stress_count (const std::bitset< N > *)
 
template<std::size_t N>
void test_elem_access (const std::bitset< N > *)
 
 _RWSTD_NAMESPACE (std)
 
const char * type_name (char)
 
const char * type_name (wchar_t)
 
const char * type_name (const UserChar &)
 
template<class charT >
const char * traits_name (const std::char_traits< charT > *)
 
const char * traits_name (const UserTraits< UserChar > *)
 
template<class charT >
const char * alloc_name (const std::allocator< charT > &)
 
template<class charT >
const char * alloc_name (const MyAlloc< charT > &)
 
template<class charT >
charT & assign (charT &lhs, char rhs)
 
UserChar & assign (UserChar &lhs, char rhs)
 
template<class charT >
int compare (const charT str[], const char s[], const char bits[2])
 
int compare (const UserChar str[], const char s[], const char bits[2])
 
template<std::size_t N, class charT , class Traits , class Alloc >
std::basic_string< charT, Traits, Alloc > bitset_to_string_3 (const std::bitset< N > &bs, int nfargs, charT zero, charT one, std::basic_string< charT, Traits, Alloc > *)
 
template<std::size_t N, class Traits , class Alloc >
std::basic_string< UserChar, Traits, Alloc > bitset_to_string_3 (const std::bitset< N > &bs, int nfargs, UserChar zero, UserChar one, std::basic_string< UserChar, Traits, Alloc > *)
 
template<std::size_t N, class charT , class Traits >
std::basic_string< charT, Traits, std::allocator< charT > > bitset_to_string_2 (const std::bitset< N > &bs, int nfargs, charT zero, charT one, std::basic_string< charT, Traits, std::allocator< charT > > *)
 
template<std::size_t N, class Traits >
std::basic_string< UserChar, Traits, std::allocator< UserChar > > bitset_to_string_2 (const std::bitset< N > &bs, int nfargs, UserChar zero, UserChar one, std::basic_string< UserChar, Traits, std::allocator< UserChar > > *)
 
template<std::size_t N, class charT >
std::basic_string< charT, std::char_traits< charT >, std::allocator< charT > > bitset_to_string_1 (const std::bitset< N > &bs, int nfargs, charT zero, charT one, std::basic_string< charT, std::char_traits< charT >, std::allocator< charT > > *)
 
template<std::size_t N>
std::basic_string< UserChar, std::char_traits< UserChar >, std::allocator< UserChar > > bitset_to_string_1 (const std::bitset< N > &bs, int nfargs, UserChar zero, UserChar one, std::basic_string< UserChar, std::char_traits< UserChar >, std::allocator< UserChar > > *)
 
template<std::size_t N>
std::basic_string< char, std::char_traits< char >, std::allocator< char > > bitset_to_string_0 (const std::bitset< N > &bs, int nfargs, char zero, char one, std::basic_string< char, std::char_traits< char >, std::allocator< char > > *)
 
char to_char (char ch)
 
char to_char (UserChar ch)
 
char to_char (wchar_t ch)
 
template<class charT , class Traits , class Alloc >
std::string narrow_string (const std::basic_string< charT, Traits, Alloc > &str)
 
std::string to_string (const char *str, const char bits[2])
 
template<std::size_t N, class charT , class Traits , class Alloc >
void test_to_string (std::bitset< N > *, charT *, Traits *, Alloc *, bool nontemplate_done)
 
template<std::size_t N>
void test_to_string (const std::bitset< N > *)
 
template<std::size_t N>
void run_test (const std::bitset< N > *)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ DO_TEST

#define DO_TEST (   N)    run_test ((std::bitset<N>*)0)

◆ FUN

#define FUN (   result,
  name,
  arg_list 
)
Value:
do { \
result (*pf) arg_list = &name; \
_RWSTD_UNUSED (pf); \
} while (0)
#define pf
Definition 17.names.cpp:516
const char * name
Definition codecvt1.cpp:72

◆ MEMFUN [1/2]

#define MEMFUN (   result,
  name,
  arg_list 
)
Value:
do { \
result (Bitset::reference::*pf) arg_list = &Bitset::reference::name; \
_RWSTD_UNUSED (pf); \
} while (0)

◆ MEMFUN [2/2]

#define MEMFUN (   result,
  name,
  arg_list 
)
Value:
do { \
result (Bitset::*pf) arg_list = &Bitset::name; \
_RWSTD_UNUSED (pf); \
} while (0)

◆ NLOOPS

#define NLOOPS   128

23.bitset.cpp - test exercising [lib.bitset]

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2001-2008 Rogue Wave Software, Inc.

Definition at line 41 of file 23.bitset.cpp.

◆ PARAMLIST

#define PARAMLIST (   T)    T, std::char_traits<T>

◆ PARAMLIST_2

#define PARAMLIST_2 (   T)    T, std::char_traits<T>

◆ PARAMLIST_3

#define PARAMLIST_3 (   T)    T, std::char_traits<T>, std::allocator<T>

◆ TEST_OP

#define TEST_OP (   op)

◆ TO_STR

#define TO_STR (   s)    narrow_string (s).c_str ()

Definition at line 1007 of file 23.bitset.cpp.

Function Documentation

◆ _RWSTD_NAMESPACE()

_RWSTD_NAMESPACE ( std  )

Definition at line 742 of file 23.bitset.cpp.

◆ alloc_name() [1/2]

template<class charT >
const char * alloc_name ( const MyAlloc< charT > &  )

Definition at line 786 of file 23.bitset.cpp.

◆ alloc_name() [2/2]

template<class charT >
const char * alloc_name ( const std::allocator< charT > &  )

Definition at line 778 of file 23.bitset.cpp.

◆ assign() [1/2]

template<class charT >
charT & assign ( charT &  lhs,
char  rhs 
)

Definition at line 794 of file 23.bitset.cpp.

◆ assign() [2/2]

UserChar & assign ( UserChar &  lhs,
char  rhs 
)

Definition at line 799 of file 23.bitset.cpp.

◆ bitmax()

std::size_t bitmax ( std::size_t  n)

Definition at line 47 of file 23.bitset.cpp.

◆ bitset_to_string_0()

template<std::size_t N>
std::basic_string< char, std::char_traits< char >, std::allocator< char > > bitset_to_string_0 ( const std::bitset< N > &  bs,
int  nfargs,
char  zero,
char  one,
std::basic_string< char, std::char_traits< char >, std::allocator< char > > *   
)

Definition at line 970 of file 23.bitset.cpp.

◆ bitset_to_string_1() [1/2]

template<std::size_t N, class charT >
std::basic_string< charT, std::char_traits< charT >, std::allocator< charT > > bitset_to_string_1 ( const std::bitset< N > &  bs,
int  nfargs,
charT  zero,
charT  one,
std::basic_string< charT, std::char_traits< charT >, std::allocator< charT > > *   
)

Definition at line 924 of file 23.bitset.cpp.

◆ bitset_to_string_1() [2/2]

template<std::size_t N>
std::basic_string< UserChar, std::char_traits< UserChar >, std::allocator< UserChar > > bitset_to_string_1 ( const std::bitset< N > &  bs,
int  nfargs,
UserChar  zero,
UserChar  one,
std::basic_string< UserChar, std::char_traits< UserChar >, std::allocator< UserChar > > *   
)

Definition at line 944 of file 23.bitset.cpp.

◆ bitset_to_string_2() [1/2]

template<std::size_t N, class charT , class Traits >
std::basic_string< charT, Traits, std::allocator< charT > > bitset_to_string_2 ( const std::bitset< N > &  bs,
int  nfargs,
charT  zero,
charT  one,
std::basic_string< charT, Traits, std::allocator< charT > > *   
)

Definition at line 883 of file 23.bitset.cpp.

◆ bitset_to_string_2() [2/2]

template<std::size_t N, class Traits >
std::basic_string< UserChar, Traits, std::allocator< UserChar > > bitset_to_string_2 ( const std::bitset< N > &  bs,
int  nfargs,
UserChar  zero,
UserChar  one,
std::basic_string< UserChar, Traits, std::allocator< UserChar > > *   
)

Definition at line 901 of file 23.bitset.cpp.

◆ bitset_to_string_3() [1/2]

template<std::size_t N, class charT , class Traits , class Alloc >
std::basic_string< charT, Traits, Alloc > bitset_to_string_3 ( const std::bitset< N > &  bs,
int  nfargs,
charT  zero,
charT  one,
std::basic_string< charT, Traits, Alloc > *   
)

Definition at line 843 of file 23.bitset.cpp.

◆ bitset_to_string_3() [2/2]

template<std::size_t N, class Traits , class Alloc >
std::basic_string< UserChar, Traits, Alloc > bitset_to_string_3 ( const std::bitset< N > &  bs,
int  nfargs,
UserChar  zero,
UserChar  one,
std::basic_string< UserChar, Traits, Alloc > *   
)

Definition at line 860 of file 23.bitset.cpp.

◆ compare() [1/2]

template<class charT >
int compare ( const charT  str[],
const char  s[],
const char  bits[2] 
)

Definition at line 809 of file 23.bitset.cpp.

◆ compare() [2/2]

int compare ( const UserChar  str[],
const char  s[],
const char  bits[2] 
)

Definition at line 824 of file 23.bitset.cpp.

◆ is_explicit()

void is_explicit ( const std::bitset< 0 > &  )

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1340 of file 23.bitset.cpp.

◆ narrow_string()

template<class charT , class Traits , class Alloc >
std::string narrow_string ( const std::basic_string< charT, Traits, Alloc > &  str)

Definition at line 997 of file 23.bitset.cpp.

◆ run_test()

template<std::size_t N>
void run_test ( const std::bitset< N > *  )

Definition at line 1285 of file 23.bitset.cpp.

◆ stress_count()

template<std::size_t N>
void stress_count ( const std::bitset< N > *  )

Definition at line 671 of file 23.bitset.cpp.

◆ stress_ctors()

template<std::size_t N>
void stress_ctors ( const std::bitset< N > *  )

Definition at line 450 of file 23.bitset.cpp.

◆ test_ctors()

template<std::size_t N>
void test_ctors ( const std::bitset< N > *  )

Definition at line 376 of file 23.bitset.cpp.

◆ test_elem_access()

template<std::size_t N>
void test_elem_access ( const std::bitset< N > *  )

Definition at line 689 of file 23.bitset.cpp.

◆ test_operators()

template<std::size_t N>
void test_operators ( const std::bitset< N > *  )

Definition at line 482 of file 23.bitset.cpp.

◆ test_other()

template<std::size_t N>
void test_other ( const std::bitset< N > *  )

Definition at line 592 of file 23.bitset.cpp.

◆ test_to_string() [1/2]

template<std::size_t N>
void test_to_string ( const std::bitset< N > *  )

Definition at line 1257 of file 23.bitset.cpp.

◆ test_to_string() [2/2]

template<std::size_t N, class charT , class Traits , class Alloc >
void test_to_string ( std::bitset< N > *  ,
charT *  ,
Traits *  ,
Alloc *  ,
bool  nontemplate_done 
)

Definition at line 1026 of file 23.bitset.cpp.

◆ to_char() [1/3]

char to_char ( char  ch)
inline

Definition at line 987 of file 23.bitset.cpp.

◆ to_char() [2/3]

char to_char ( UserChar  ch)
inline

Definition at line 988 of file 23.bitset.cpp.

◆ to_char() [3/3]

char to_char ( wchar_t  ch)
inline

Definition at line 991 of file 23.bitset.cpp.

◆ to_string()

std::string to_string ( const char *  str,
const char  bits[2] 
)

Definition at line 1012 of file 23.bitset.cpp.

◆ traits_name() [1/2]

template<class charT >
const char * traits_name ( const std::char_traits< charT > *  )

Definition at line 762 of file 23.bitset.cpp.

◆ traits_name() [2/2]

const char * traits_name ( const UserTraits< UserChar > *  )

Definition at line 769 of file 23.bitset.cpp.

◆ type_name() [1/3]

const char * type_name ( char  )

Definition at line 750 of file 23.bitset.cpp.

◆ type_name() [2/3]

const char * type_name ( const UserChar &  )

Definition at line 756 of file 23.bitset.cpp.

◆ type_name() [3/3]

const char * type_name ( wchar_t  )

Definition at line 753 of file 23.bitset.cpp.