text:
using namespace BloombergLP;

//=============================================================================
//                             TEST PLAN
//-----------------------------------------------------------------------------
//                              Overview
//                              --------
// An allocator is a value-semantic type whose value consists of a single
// pointer to a 'bslma::Allocator' object (its underlying "mechanism").  This
// pointer can be set at construction (and if 0 is passed, then it uses
// 'bslma_default' to substitute a pointer to the currently installed default
// allocator), and it can be accessed through the 'mechanism' accessor.  It
// cannot be reset, however, since normally an allocator does not change during
// the lifetime of an object.  A 'bsl::allocator' is parameterized by the type
// that it allocates, and that influences the behavior of several manipulators
// and accessors, mainly depending on the size of that type.  The same
// 'bsl::allocator" can be re-parameterized for another type ("rebound") using
// the 'rebind' nested template.
//
// Although 'bsl::allocator' is a value-semantic type, the fact that its value
// is fixed at construction and not permitted to change let us relax the usual
// concerns of a typical value-semantic type.  Our specific concerns are that
// an allocator constructed with a certain underlying mechanism actually uses
// that mechanism to allocate memory, and that its rebound versions also do.
// Another concern is that the 'max_size' is the maximum possible size for that
// type (i.e., it is impossible to meaningfully pass in a larger size), and
// that the 'size_type' is unsigned, the 'difference_type' is signed, and
// generally all the requirements of C++ standard allocators are met (20.1.2
// [allocator.requirements]).
//-----------------------------------------------------------------------------
// [ 3] bsl::allocator();
// [ 3] bsl::allocator(bslma::Allocator *);
// [ 3] bsl::allocator(const bsl::allocator&);
// [ 3] bsl::allocator(const bsl::allocator<U>&);
// [  ] ~bsl::allocator();
//
// Modifiers
// [  ] allocator& operator=(const allocator& rhs);
// [  ] pointer allocate(size_type n, const void *hint = 0);
// [  ] void deallocate(pointer p, size_type n = 1);
// [  ] void construct(pointer p, const TYPE& val);
// [  ] void destroy(pointer p);
//
// Accessors
// [  ] pointer address(reference x) const;
// [  ] const_pointer address(const_reference x) const;
// [ 4] bslma::Allocator *mechanism() const;
// [ 4] size_type max_size() const;
//
// Nested types
// [ 5] bsl::allocator::size_type
// [ 5] bsl::allocator::difference_type
// [ 5] bsl::allocator::pointer;
// [ 5] bsl::allocator::const_pointer;
// [ 5] bsl::allocator::reference;
// [ 5] bsl::allocator::const_reference;
// [ 5] bsl::allocator::value_type;
// [ 5] template rebind<U>::other
//
// Free functions (operators)
// [ 4] bool operator==(bsl::allocator<T>,  bsl::allocator<T>);
// [  ] bool operator==(bsl::allocator<T1>,  bsl::allocator<T2>);
// [ 4] bool operator==(bslma::Allocator *, bsl::allocator<T>);
// [ 4] bool operator==(bsl::allocator<T>,  bslma::Allocator*);
// [  ] bool operator!=(bsl::allocator<T1>,  bsl::allocator<T2>);
// [  ] bool operator!=(bslma::Allocator *, bsl::allocator<T>);
// [  ] bool operator!=(bsl::allocator<T>,  bslma::Allocator*);
//-----------------------------------------------------------------------------
// [ 1] BREATHING TEST
// [ 6] USAGE EXAMPLE
// [ 2] bsl::is_trivially_copyable<bsl::allocator>
// [ 2] bslmf::IsBitwiseEqualityComparable<sl::allocator>
// [ 2] bslmf::IsBitwiseMoveable<bsl::allocator>

// ============================================================================
//                      STANDARD BDE ASSERT TEST MACROS
// ----------------------------------------------------------------------------
// NOTE: THIS IS A LOW-LEVEL COMPONENT AND MAY NOT USE ANY C++ LIBRARY
// FUNCTIONS, INCLUDING IOSTREAMS.

namespace {

int testStatus = 0;

void aSsErT(bool b, const char *s, int i)
{
    if (b) {
        printf("Error " __FILE__ "(%d): %s    (failed)\n", i, s);
        if (testStatus >= 0 && testStatus <= 100) ++testStatus;
    }
}

}  // close unnamed namespace

//=============================================================================
//                       STANDARD BDE TEST DRIVER MACROS
//-----------------------------------------------------------------------------

#define ASSERT       BSLS_BSLTESTUTIL_ASSERT
#define LOOP_ASSERT  BSLS_BSLTESTUTIL_LOOP_ASSERT
#define LOOP0_ASSERT BSLS_BSLTESTUTIL_LOOP0_ASSERT
#define LOOP1_ASSERT BSLS_BSLTESTUTIL_LOOP1_ASSERT
#define LOOP2_ASSERT BSLS_BSLTESTUTIL_LOOP2_ASSERT
#define LOOP3_ASSERT BSLS_BSLTESTUTIL_LOOP3_ASSERT
#define LOOP4_ASSERT BSLS_BSLTESTUTIL_LOOP4_ASSERT
#define LOOP5_ASSERT BSLS_BSLTESTUTIL_LOOP5_ASSERT
#define LOOP6_ASSERT BSLS_BSLTESTUTIL_LOOP6_ASSERT
#define ASSERTV      BSLS_BSLTESTUTIL_ASSERTV

#define Q   BSLS_BSLTESTUTIL_Q   // Quote identifier literally.
#define P   BSLS_BSLTESTUTIL_P   // Print identifier and value.
#define P_  BSLS_BSLTESTUTIL_P_  // P(X) without '\n'.
#define T_  BSLS_BSLTESTUTIL_T_  // Print a tab (w/o newline).
#define L_  BSLS_BSLTESTUTIL_L_  // current Line number

// ============================================================================
//                  NEGATIVE-TEST MACRO ABBREVIATIONS
// ----------------------------------------------------------------------------

#define ASSERT_SAFE_PASS(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_PASS(EXPR)
#define ASSERT_SAFE_FAIL(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_FAIL(EXPR)
#define ASSERT_PASS(EXPR)      BSLS_ASSERTTEST_ASSERT_PASS(EXPR)
#define ASSERT_FAIL(EXPR)      BSLS_ASSERTTEST_ASSERT_FAIL(EXPR)
#define ASSERT_OPT_PASS(EXPR)  BSLS_ASSERTTEST_ASSERT_OPT_PASS(EXPR)
#define ASSERT_OPT_FAIL(EXPR)  BSLS_ASSERTTEST_ASSERT_OPT_FAIL(EXPR)

#define ASSERT_SAFE_PASS_RAW(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_PASS_RAW(EXPR)
#define ASSERT_SAFE_FAIL_RAW(EXPR) BSLS_ASSERTTEST_ASSERT_SAFE_FAIL_RAW(EXPR)
#define ASSERT_PASS_RAW(EXPR)      BSLS_ASSERTTEST_ASSERT_PASS_RAW(EXPR)
#define ASSERT_FAIL_RAW(EXPR)      BSLS_ASSERTTEST_ASSERT_FAIL_RAW(EXPR)
#define ASSERT_OPT_PASS_RAW(EXPR)  BSLS_ASSERTTEST_ASSERT_OPT_PASS_RAW(EXPR)
#define ASSERT_OPT_FAIL_RAW(EXPR)  BSLS_ASSERTTEST_ASSERT_OPT_FAIL_RAW(EXPR)

// ============================================================================
//                           PRINTF FORMAT MACROS
// ----------------------------------------------------------------------------
#define ZU BSLS_BSLTESTUTIL_FORMAT_ZU

//=============================================================================
//                  GLOBAL TYPEDEFS/CONSTANTS FOR TESTING
//-----------------------------------------------------------------------------

enum { VERBOSE_ARG_NUM = 2, VERY_VERBOSE_ARG_NUM, VERY_VERY_VERBOSE_ARG_NUM };

//=============================================================================
//                  GLOBAL HELPER FUNCTIONS FOR TESTING
//-----------------------------------------------------------------------------

//=============================================================================
//                            USAGE EXAMPLE
//-----------------------------------------------------------------------------

///Usage
///-----
// We first show how to define a container type parameterized with an STL-style
// allocator template parameter.  For simplicity, we choose a fixed-size array
// to avoid issues concerning reallocation, dynamic growth, etc.  Furthermore,
// we do not assume the 'bslma' allocation protocol, which would dictate that
// we pass-through the allocator to the parameterized 'T' contained type (see
// the 'bslma_allocator' component and 'bslalg' package).  The interface would
// be as follows:
//..
    // my_fixedsizearray.h

                               // =======================
                               // class my_FixedSizeArray
                               // =======================

    template <class TYPE, class ALLOC>
    class my_FixedSizeArray {
        // This class provides an array of (the template parameter) 'TYPE'
        // passed of fixed length at construction, using an instance of the
        // parameterized 'ALLOC' type to supply memory.

        // DATA
        ALLOC  d_allocator;
        int    d_length;
        TYPE  *d_array;

        // INVARIANTS

      public:
        // TYPES
        typedef ALLOC  allocator_type;
        typedef TYPE   value_type;

        // CREATORS
        explicit my_FixedSizeArray(int length,
                                   const ALLOC& allocator = ALLOC());
            // Create a fixed-size array of the specified 'length', using the
            // optionally specified 'allocator' to supply memory.  If
            // 'allocator' is not specified, a default-constructed instance of
            // the parameterized 'ALLOC' type is used.  Note that all the
            // elements in that array are default-constructed.

        my_FixedSizeArray(const my_FixedSizeArray& original,
                          const ALLOC&             allocator = ALLOC());
            // Create a copy of the specified 'original' fixed-size array,
            // using the optionally specified 'allocator' to supply memory.  If
            // 'allocator' is not specified, a default-constructed instance of
            // the parameterized 'ALLOC' type is used.

        ~my_FixedSizeArray();
            // Destroy this fixed size array.

        // MANIPULATORS
        TYPE& operator[](int index);
            // Return a reference to the modifiable element at the specified
            // 'index' position in this fixed size array.

        // ACCESSORS
        const TYPE& operator[](int index) const;
            // Return a reference to the modifiable element at the specified
            // 'index' position in this fixed size array.

        const ALLOC& allocator() const;
            // Return a reference to the non-modifiable allocator used by this
            // fixed size array to supply memory.  This is here for
            // illustrative purposes.  We should not generally have an accessor
            // to return the allocator.

        int length() const;
            // Return the length specified at construction of this fixed size
            // array.
    };

    // FREE OPERATORS
    template<class TYPE, class ALLOC>
    bool operator==(const my_FixedSizeArray<TYPE, ALLOC>& lhs,
                    const my_FixedSizeArray<TYPE, ALLOC>& rhs);
        // Return 'true' if the specified 'lhs' fixed-size array has the same
        // value as the specified 'rhs' fixed-size array, and 'false'
        // otherwise.  Two fixed-size arrays have the same value if they have
        // the same length and if the element at any index in 'lhs' has the
        // same value as the corresponding element at the same index in 'rhs'.

    namespace BloombergLP {
    namespace bslma {

    template <class TYPE, class ALLOC>
    struct UsesBslmaAllocator< my_FixedSizeArray<TYPE, ALLOC> >
    : bsl::is_convertible<Allocator*, ALLOC>::type
    {
    };

    }  // close namespace bslma
    }  // close enterprise namespace

//..
// The implementation is straightforward
//..
                           // ----------------------
                           // class my_FixedSizeArray
                           // ----------------------

    // CREATORS
    template<class TYPE, class ALLOC>
    my_FixedSizeArray<TYPE, ALLOC>::my_FixedSizeArray(int          length,
                                                      const ALLOC& allocator)
    : d_allocator(allocator), d_length(length)
    {
        d_array = d_allocator.allocate(d_length);  // sizeof(T)*d_length bytes

        // Default construct each element of the array:
        for (int i = 0; i < d_length; ++i) {
            d_allocator.construct(&d_array[i], TYPE());
        }
    }

    template<class TYPE, class ALLOC>
    my_FixedSizeArray<TYPE, ALLOC>::my_FixedSizeArray(
                                            const my_FixedSizeArray& original,
                                            const ALLOC&             allocator)
    : d_allocator(allocator), d_length(original.d_length)
    {
        d_array = d_allocator.allocate(d_length);  // sizeof(T)*d_length bytes

        // copy construct each element of the array:
        for (int i = 0; i < d_length; ++i) {
            d_allocator.construct(&d_array[i], original.d_array[i]);
        }
    }

    template<class TYPE, class ALLOC>
    my_FixedSizeArray<TYPE, ALLOC>::~my_FixedSizeArray()
    {
        // Call destructor for each element
        for (int i = 0; i < d_length; ++i) {
            d_allocator.destroy(&d_array[i]);
        }

        // Return memory to allocator.
        d_allocator.deallocate(d_array, d_length);
    }

    // MANIPULATORS
    template<class TYPE, class ALLOC>
    inline TYPE& my_FixedSizeArray<TYPE, ALLOC>::operator[](int index)
    {
        return d_array[index];
    }

    // ACCESSORS
    template<class TYPE, class ALLOC>
    inline
    const TYPE& my_FixedSizeArray<TYPE, ALLOC>::operator[](int index) const
    {
        return d_array[index];
    }

    template<class TYPE, class ALLOC>
    inline
    const ALLOC& my_FixedSizeArray<TYPE, ALLOC>::allocator() const
    {
        return d_allocator;
    }

    // FREE OPERATORS
    template<class TYPE, class ALLOC>
    bool operator==(const my_FixedSizeArray<TYPE, ALLOC>& lhs,
                    const my_FixedSizeArray<TYPE, ALLOC>& rhs)
    {
        if (lhs.length() != rhs.length()) {
            return false;                                             // RETURN
        }
        for (int i = 0; i < lhs.length(); ++i) {
            if (lhs[i] != rhs[i]) {
                return false;                                         // RETURN
            }
        }
        return true;
    }

    template<class TYPE, class ALLOC>
    inline int my_FixedSizeArray<TYPE, ALLOC>::length() const
    {
        return d_length;
    }

//..
// Now we declare an allocator mechanism.  Our mechanism will be to simply call
// the global 'operator new' and 'operator delete' functions, and count the
// number of blocks outstanding (allocated but not deallocated).  Note that a
// more reusable implementation would take an underlying mechanism at
// construction.  We keep things simple only for the sake of this example.
//..
    // my_countingallocator.h

                             // ==========================
                             // class my_CountingAllocator
                             // ==========================

    class my_CountingAllocator : public bslma::Allocator {
        // This concrete implementation of the 'bslma::Allocator' protocol
        // maintains some statistics of the number of blocks outstanding (i.e.,
        // allocated but not yet deallocated).

        // DATA
        int d_blocksOutstanding;

      public:
        // CREATORS
        my_CountingAllocator();
            // Create a counting allocator that uses the operators 'new' and
            // 'delete' to supply and free memory.

        // MANIPULATORS
        virtual void *allocate(size_type size);
            // Return a pointer to an uninitialized memory of the specified
            // 'size (in bytes).

        virtual void deallocate(void *address);
            // Return the memory at the specified 'address' to this allocator.

        // ACCESSORS
        int blocksOutstanding() const;
            // Return the number of blocks outstanding (i.e., allocated but not
            // yet deallocated by this counting allocator).
    };
//..
// The implementation is really straightforward:
//..
    // my_countingallocator.cpp

                             // -------------------------
                             // class my_CountingAllocator
                             // -------------------------

    // CREATORS
    my_CountingAllocator::my_CountingAllocator()
    : d_blocksOutstanding(0)
    {
    }

    // MANIPULATORS
    void *my_CountingAllocator::allocate(size_type size)
    {
        ++d_blocksOutstanding;
        return operator new(size);
    }

    void my_CountingAllocator::deallocate(void *address)
    {
        --d_blocksOutstanding;
        operator delete(address);
    }

    // ACCESSORS
    int my_CountingAllocator::blocksOutstanding() const
    {
        return d_blocksOutstanding;
    }
//..
// Now we can create array objects with different allocator mechanisms.  First
// we create an array, 'a1', using the default allocator and fill it with the
// values '1 .. 5':
//..
    void usageExample() {

        my_FixedSizeArray<int, bsl::allocator<int> > a1(5);
        ASSERT(5 == a1.length());
        ASSERT(bslma::Default::defaultAllocator() == a1.allocator());

        for (int i = 0; i < a1.length(); ++i) {
            a1[i] = i + 1;
        }
//..
// Then we create a copy of 'a1' using the counting allocator.  The values of
// 'a1' and 'a2' are equal, even though they have different allocation
// mechanisms.
//..
        my_CountingAllocator countingAlloc;
        my_FixedSizeArray<int, bsl::allocator<int> > a2(a1,&countingAlloc);
                   ASSERT(a1 == a2);
                   ASSERT(a1.allocator() != a2.allocator());
                   ASSERT(&countingAlloc == a2.allocator());
                   ASSERT(1 == countingAlloc.blocksOutstanding());
    }
//..

                              // ===============
                              // struct MyObject
                              // ===============

struct MyObject
{
    // A non-trivial-sized object.

    // DATA
    int  d_i;
    char d_s[10];
};

//=============================================================================
//                              MAIN PROGRAM
//-----------------------------------------------------------------------------

int main(int argc, char *argv[])
{
    int                 test = argc > 1 ? atoi(argv[1]) : 0;
    bool             verbose = argc > 2;
    bool         veryVerbose = argc > 3;
    bool     veryVeryVerbose = argc > 4;
    bool veryVeryVeryVerbose = argc > 5;

    (void) veryVerbose;
    (void) veryVeryVerbose;

    bslma::TestAllocator globalAllocator("global", veryVeryVeryVerbose);
    bslma::Default::setGlobalAllocator(&globalAllocator);

    bslma::TestAllocator defaultAllocator("default", veryVeryVeryVerbose);
    ASSERT(0 == bslma::Default::setDefaultAllocator(&defaultAllocator));

    setbuf(stdout, NULL);    // Use unbuffered output

    printf("TEST " __FILE__ " CASE %d\n", test);

    switch (test) { case 0:  // Zero is always the leading case.
      case 6: {
        // --------------------------------------------------------------------
        // USAGE EXAMPLE
        //
        // Concerns:  The usage example must compile end execute without
        //   errors.
        //
        // Plan:  Copy-paste the usage example and replace 'assert' by
        //   'ASSERT'.
        //
        // Testing:
        //   USAGE EXAMPLE
        // --------------------------------------------------------------------

        bslma::TestAllocator ta("default for usage", veryVeryVeryVerbose);
        bslma::DefaultAllocatorGuard allocGuard(&ta);

        if (verbose) printf("\nUSAGE EXAMPLE"
                            "\n=============\n");

        usageExample();

      } break;
      case 5: {
        // --------------------------------------------------------------------
        // TESTING NESTED TYPES
        //
        // Concerns:
        //   o that 'size_type' is unsigned while 'difference_type' is signed.
        //   o that size_type and difference_type are the right size (i.e.,
        //     they can represent any difference of pointers in the memory
        //     model)
        //   o that all other types exist and are as specified by the C++
        //     standard
        //   o that if Y is X::rebind<U>::other, then Y::rebind<T>::other is
        //     the same type as X
        //
        // Plan: The testing is straightforward and follows the concerns.
        //
        // Testing:
        //   bsl::allocator::size_type
        //   bsl::allocator::difference_type
        //   bsl::allocator::pointer;
        //   bsl::allocator::const_pointer;
        //   bsl::allocator::reference;
        //   bsl::allocator::const_reference;
        //   bsl::allocator::value_type;
        //   template rebind<U>::other
        // --------------------------------------------------------------------

        if (verbose) printf("\nTESTING NESTED TYPES"
                            "\n====================\n");

        typedef bsl::allocator<int>   AI;
        typedef bsl::allocator<float> AF;
        typedef bsl::allocator<void>  AV;

        if (verbose) printf("\tTesting 'size_type'.\n");
        {
            ASSERT(sizeof(AI::size_type) == sizeof(int*));
            ASSERT(sizeof(AV::size_type) == sizeof(void*));

            ASSERT(0 < ~(AI::size_type)0);
            ASSERT(0 < ~(AV::size_type)0);
        }

        if (verbose) printf("\tTesting 'difference_type'.\n");
        {
            ASSERT(sizeof(AI::difference_type) == sizeof(int*));
            ASSERT(sizeof(AV::difference_type) == sizeof(void*));

            ASSERT(0 > ~(AI::difference_type)0);
            ASSERT(0 > ~(AV::difference_type)0);
        }

        if (verbose) printf("\tTesting 'pointer'.\n");
        {
            ASSERT((bsl::is_same<AI::pointer, int*>::value));
            ASSERT((bsl::is_same<AF::pointer, float*>::value));
            ASSERT((bsl::is_same<AV::pointer, void*>::value));
        }

        if (verbose) printf("\tTesting 'const_pointer'.\n");
        {
            ASSERT((bsl::is_same<AI::const_pointer, const int*>::value));
            ASSERT((bsl::is_same<AF::const_pointer, const float*>::value));
            ASSERT((bsl::is_same<AV::const_pointer, const void*>::value));
        }

        if (verbose) printf("\tTesting 'reference'.\n");
        {
            ASSERT((bsl::is_same<AI::reference, int&>::value));
            ASSERT((bsl::is_same<AF::reference, float&>::value));
        }

        if (verbose) printf("\tTesting 'const_reference'.\n");
        {
            ASSERT((bsl::is_same<AI::const_reference, const int&>::value));
            ASSERT((bsl::is_same<AF::const_reference, const float&>::value));
        }

        if (verbose) printf("\tTesting 'value_type'.\n");
        {
            ASSERT((bsl::is_same<AI::value_type, int>::value));
            ASSERT((bsl::is_same<AF::value_type, float>::value));
            ASSERT((bsl::is_same<AV::value_type, void>::value));
        }

        if (verbose) printf("\tTesting 'rebind'.\n");
        {
            ASSERT((bsl::is_same<AI::rebind<int  >::other, AI>::value));
            ASSERT((bsl::is_same<AI::rebind<float>::other, AF>::value));
            ASSERT((bsl::is_same<AI::rebind<void >::other, AV>::value));
            ASSERT((bsl::is_same<AF::rebind<int  >::other, AI>::value));
            ASSERT((bsl::is_same<AF::rebind<float>::other, AF>::value));
            ASSERT((bsl::is_same<AF::rebind<void >::other, AV>::value));
            ASSERT((bsl::is_same<AV::rebind<int  >::other, AI>::value));
            ASSERT((bsl::is_same<AV::rebind<float>::other, AF>::value));
            ASSERT((bsl::is_same<AV::rebind<void >::other, AV>::value));
        }

      } break;
      case 4: {
        // --------------------------------------------------------------------
        // TESTING ACCESSORS
        //
        // Concerns:
        //   o that the correct 'bslma::Allocator*' is returned by 'mechanism'.
        //   o that the result of 'max_size' fits and represents the maximum
        //     possible number of bytes in a 'bslma::Allocator::size_type'.
        //   o that all comparisons exist and resolve to comparing the
        //     mechanisms.
        //
        // Plan: The concerns are straightforward to test.
        //
        // Testing:
        //   bslma::Allocator *mechanism() const;
        //   size_type max_size() const;
        //   bool operator==(bsl::allocator<T>,  bsl::allocator<T>);
        //   bool operator==(bslma::Allocator *, bsl::allocator<T>);
        //   bool operator==(bsl::allocator<T>,  bslma::Allocator*);
        // --------------------------------------------------------------------

        if (verbose) printf("\nTESTING ACCESSORS"
                            "\n=================\n");

        bslma::Allocator *dflt = bslma::Default::allocator();

        if (verbose) printf("\tTesting 'mechanism()'.\n");
        {
            bslma::TestAllocator ta(veryVeryVeryVerbose);

            bsl::allocator<int>  ai1;       ASSERT(dflt == ai1.mechanism());
            bsl::allocator<int>  ai2(&ta);  ASSERT(&ta  == ai2.mechanism());
            bsl::allocator<int>  ai4(0);    ASSERT(dflt == ai4.mechanism());

            bsl::allocator<void> av1;       ASSERT(dflt == av1.mechanism());
            bsl::allocator<void> av2(&ta);  ASSERT(&ta  == av2.mechanism());
            bsl::allocator<void> av4(0);    ASSERT(dflt == av4.mechanism());

            bsl::allocator<int>  ai5(av2);  ASSERT(&ta  == ai5.mechanism());
            bsl::allocator<void> av5(ai2);  ASSERT(&ta  == av5.mechanism());
        }

        if (verbose) printf("\tTesting 'max_size()'.\n");
        {
            typedef bslma::Allocator::size_type bsize;

            bsl::allocator<char> charAlloc;
            bsize cas = charAlloc.max_size();

            // verify that max_size() is the largest positive integer of type
            // size_type
            LOOP_ASSERT(cas, cas > 0);
            LOOP_ASSERT(cas, cas == std::numeric_limits<bsize>::max());

            if (verbose) {
                printf("cas = " ZU "\n", cas);
            }

            bsl::allocator<MyObject> objAlloc;

            // Detect problem with MSVC in 64-bit mode, which can't do 64-bit
            // int arithmetic correctly for enums.
            ASSERT(objAlloc.max_size() < charAlloc.max_size());

            bsize oas = objAlloc.max_size();
            bsize oass = oas * sizeof(MyObject);
            bsize oassplus = oass + sizeof(MyObject);
            LOOP_ASSERT(oas, oas > 0);
            LOOP_ASSERT(oass, oass < cas);
            LOOP_ASSERT(oass, oass > oas);         // no overflow
            LOOP_ASSERT(oassplus, oassplus < oas); // overflow

            if (verbose) {
                printf("\tAs unsigned long: oas = " ZU ", oass = " ZU ", "
                       "oassplus = " ZU ".\n", oas, oass, oassplus);
            }
        }

        if (verbose) printf("\tTesting 'operator=='.\n");
        {
            bslma::TestAllocator ta1(veryVeryVeryVerbose);
            bslma::TestAllocator ta2(veryVeryVeryVerbose);

            bsl::allocator<int>  ai1(&ta1);
            bsl::allocator<int>  ai2(&ta2);

            bsl::allocator<void> av1(&ta1);
            bsl::allocator<void> av2(&ta2);

            // One of lhs or rhs is 'bslma::Allocator *'.

            ASSERT(&ta1 == ai1);  ASSERT(ai1 == &ta1);
            ASSERT(&ta2 != ai1);  ASSERT(ai1 != &ta2);

            ASSERT(&ta1 == ai1);  ASSERT(ai1 == &ta1);
            ASSERT(&ta2 != ai1);  ASSERT(ai1 != &ta2);

            ASSERT(&ta1 == av1);  ASSERT(av1 == &ta1);
            ASSERT(&ta2 != av1);  ASSERT(av1 != &ta2);

            ASSERT(&ta1 == av1);  ASSERT(av1 == &ta1);
            ASSERT(&ta2 != av1);  ASSERT(av1 != &ta2);

            // Both lhs and rhs are 'bsl::allocator'.

            ASSERT(ai1 == ai1);  ASSERT(ai1 != ai2);
            ASSERT(ai1 == av1);  ASSERT(ai1 != av2);

            ASSERT(av1 == ai1);  ASSERT(av1 != ai2);
            ASSERT(av1 == av1);  ASSERT(av1 != av2);

            ASSERT(ai2 != ai1);  ASSERT(ai2 == ai2);
            ASSERT(ai2 != av1);  ASSERT(ai2 == av2);

            ASSERT(av2 != ai1);  ASSERT(av2 == ai2);
            ASSERT(av2 != av1);  ASSERT(av2 == av2);
        }

      } break;
      case 3: {
        // --------------------------------------------------------------------
        // TESTING CONSTRUCTORS
        //
        // Concerns:
        //   o that an allocator can be constructed from the various
        //     constructors and that it uses the correct mechanism object.
        //   o that an allocator can be constructed from an allocator to a
        //     different type
        //
        // Plan:  We construct a number of allocators from various mechanisms,
        //   and test that they do compare equal to the selected mechanism.
        //   Copy constructed allocators have to compare equal to their
        //   original values.
        //
        // Testing:
        //   bsl::allocator();
        //   bsl::allocator(bslma::Allocator *);
        //   bsl::allocator(const bsl::allocator&);
        //   bsl::allocator(const bsl::allocator<U>&);
        // --------------------------------------------------------------------

        if (verbose) printf("\nTESTING CONSTRUCTORS"
                            "\n====================\n");

        bslma::Allocator *dflt = bslma::Default::allocator();

        bslma::TestAllocator ta("test case 3", veryVeryVeryVerbose);

        bsl::allocator<int>  ai1;        ASSERT(dflt == ai1);
        bsl::allocator<int>  ai2(&ta);   ASSERT(&ta  == ai2);
        bsl::allocator<int>  ai3(ai2);   ASSERT(&ta  == ai3);
        bsl::allocator<int>  ai4(0);     ASSERT(dflt == ai4);

        bsl::allocator<void> av1;        ASSERT(dflt == av1);
        bsl::allocator<void> av2(&ta);   ASSERT(&ta  == av2);
        bsl::allocator<void> av3(av2);   ASSERT(&ta  == av3);
        bsl::allocator<void> av4(0);     ASSERT(dflt == av4);

        bsl::allocator<int>  ai5(av2);   ASSERT(av2  == ai5);
        bsl::allocator<void> av5(ai2);   ASSERT(ai2  == av5);

      } break;
      case 2: {
        // --------------------------------------------------------------------
        // TESTING TRAITS
        //
        // Concerns:
        //   That an allocator has the proper traits defined.
        //
        // Plan: Since it does not matter what type 'bsl::allocator' is
        // instantiated with, use 'int' and test for each expected trait.
        // Note that 'void' also needs to be tested since it is a
        // specialization.
        //
        // Testing:
        //   bsl::is_trivially_copyable<bsl::allocator>
        //   bslmf::IsBitwiseEqualityComparable<sl::allocator>
        //   bslmf::IsBitwiseMoveable<bsl::allocator>
        // --------------------------------------------------------------------

        if (verbose) printf("\nTESTING TRAITS"
                            "\n==============\n");

        ASSERT((bslmf::IsBitwiseMoveable<bsl::allocator<int> >::value));
        ASSERT((bsl::is_trivially_copyable<bsl::allocator<int> >::value));
        ASSERT((bslmf::IsBitwiseEqualityComparable<
                                                bsl::allocator<int> >::value));

        ASSERT((bslmf::IsBitwiseMoveable<bsl::allocator<void> >::value));
        ASSERT((bsl::is_trivially_copyable<bsl::allocator<void> >::value));
        ASSERT((bslmf::IsBitwiseEqualityComparable<
                                               bsl::allocator<void> >::value));

      } break;

      case 1: {
        // --------------------------------------------------------------------
        // BREATHING TEST
        //    This test case exercises the component but *tests* nothing.
        //
        // Concerns:
        //
        // Plan:
        //
        // Testing:
        //   BREATHING TEST
        // --------------------------------------------------------------------

        if (verbose) printf("\nBREATHING TEST"
                            "\n==============\n");

        bslma::TestAllocator ta("breathing test A", veryVeryVeryVerbose);
        bslma::TestAllocator tb("breathing test B", veryVeryVeryVerbose);

        my_FixedSizeArray<int, bsl::allocator<int> > a1(5, &ta);

        ASSERT(5 == a1.length());
//        ASSERT(bslma::Default::defaultAllocator() == a1.allocator());
        ASSERT(&ta == a1.allocator());

        for (int i = 0; i < a1.length(); ++i) {
            a1[i] = i + 1;
        }

        my_CountingAllocator countingAlloc;
        my_FixedSizeArray<int, bsl::allocator<int> > a2(a1, &countingAlloc);

        ASSERT(a1 == a2);
        ASSERT(a1.allocator() != a2.allocator());
        ASSERT(&countingAlloc == a2.allocator());
        ASSERT(1 == countingAlloc.blocksOutstanding());

        bsl::allocator<int> aiA(&ta);
        bsl::allocator<int> aiB(&tb);

        ASSERT(aiA != aiB);
        bsl::allocator<int>& aiC = (aiB = aiA);
        ASSERT(aiA == aiB);
        ASSERT(&aiC == &aiB);

        // Test that this will compile:

        bsl::allocator<void> voidAlloc(&countingAlloc);

      } break;
      default: {
        fprintf(stderr, "WARNING: CASE `%d' NOT FOUND.\n", test);
        testStatus = -1;
      }
    }

    // CONCERN: In no case does memory come from the default allocator.
    ASSERTV(defaultAllocator.numBlocksTotal(),
            0 == defaultAllocator.numBlocksTotal());

    // CONCERN: In no case does memory come from the global allocator.
    ASSERTV(globalAllocator.numBlocksTotal(),
            0 == globalAllocator.numBlocksTotal());

    if (testStatus > 0) {
        fprintf(stderr, "Error, non-zero test status = %d.\n", testStatus);
    }
    return testStatus;
}

// ----------------------------------------------------------------------------
// Copyright 2013 Bloomberg Finance L.P.
//
// Licensed 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.
// ----------------------------- END-OF-FILE ----------------------------------

redpajama_set_name: RedPajamaGithub


text:
Reluctant American
Posted byChristopher Goodlof December 24, 2019 June 28, 2020 Posted inJournalism, Political
For 47 years he waited to make it real.
Now that it's real, he feels nothing.
No pride, no accomplishment – he returned to work the next day.
José Brito is a 64-year-old Ecuadorian immigrant who has lived in the United States for 47 years, and only in 2018 did he become a citizen.
In those 47 years, Brito married a woman with five children who he helped raise, had two children of his own, and became a grandfather several times over.
Brito wasn't longing to be considered an "American," nor did he feel like an outcast.
So, why now? Why wait?
Brito just wanted to be covered. Things are changing, and he doesn't even want to entertain the notion of being sent back to Ecuador. Home is here for José.
Brito was born in Guayaquil, Ecuador in 1955 where he lived with his parents, two younger sisters, and his brother. Life was quiet, but life was good.
Brito and his family were middle class. They had all they needed, and wanted for little. But still, José's father wanted more than Guayaquil could offer them. And so, in 1968 his dad left for New York City. He would send for his wife and children once he had a place for them to go.
When all was said and done, it took six years for Brito's whole family to make it to the United States and be together once again.
A year passed, then two, then three. Four years after he left, Brito's father sent for him and one of his sisters. In May of 1972, José and his sister boarded a flight to New York City where their father already arranged for their permanent resident status.
"All I remember is, 'OK, I'm ready to come, this is the date,'" said Brito, "and then you know you're coming, and then you just separate from everybody."
Brito's father was a cook at a college in Upstate New York. For the first few days, Brito and his sister stayed with their dad at the college before moving into a coworker's house for a few weeks.
Then through some friends, the three managed to find a spacious two-bedroom corner apartment in New York City for $250 a month in a quiet neighborhood. All the while, José's father was preparing to send for his wife and remaining children in Ecuador.
In 1974, the family was finally reunited – mother, father, and all their children together in Manhattan, all permanent residents. Life could once again resume.
Brito was 16 when he arrived in America, right in the middle of high school. However, because of the language barrier he couldn't just pick up where he left off. Brito would later get his GED after learning English and getting a foothold in his new country.
But what of Ecuador? Was it hard to leave home?
"For me, no," said Brito. "I don't know about anybody else, but for me it was fine."
High school was out of the question, but José needed to work. No less than a month after moving to the city, Brito landed a job at a factory in Secaucus, New Jersey where he worked in shipping and receiving for quite some time.
In 1981, José moved to New Jersey. He was 27, had great hair, flashy boots, and the world in the palm of his hands. He went out a lot, partying and meeting people. Then in 1983, Brito's friend introduced him to Marise, and everything changed.
Marise had five children from a previous marriage when she met José, but that didn't bother him. He was 27, and not necessarily in the "kids" mindset, but he liked Marise, and her kids were part of the deal so he had to get with it or move on.
He got with it.
"As kids they were always shy," said Brito, "and then I started to be more around and stuff. So yeah, that's how we pretty much became a family. It's pretty cool now that you take me back."
And so, José became a father to Marise's five children, who would come to call him "dad" in time.
Five kids were not enough. In 1983, Marise gave birth to Stephanie, her sixth child but José's first. Life was good, but they still weren't married. Much like citizenship, marriage didn't matter much to José. He was with Marise for years, they were raising a family, they were together, and they were happy – they didn't need a courthouse to give them that. No courthouse can give you that.
But Marise's parents were devout Catholics. They didn't like their daughter "living in sin" with a man to whom she wasn't married. In 1990, seven after Stephanie's birth, and nine years after starting their life together, José and Marise were married.
"We made it legal first, but then I wanted to get married in the eyes of God," said Marise. "My mother and father were the witnesses, we didn't have a big wedding because all of my kids thought we were married already. My mother and father were very religious. It was scandalous, we were living in sin. They were very traditional, hardcore traditional, they went to mass every day."
"She [Marise's mother] was on us all the time," said José.
A year after the wedding, Marise gave birth to her seventh and final child, Joseph, named after his father. The family was complete – there was Marise and Jose, and their children Karina, Janine, Jennifer, Christopher, Daniel, Stephanie, and the youngest, Joseph.
Their lives went largely unimpeded. Children move out, get married, move on. The house was sort of like a school, kids matriculated out once they were ready to move on. There was no time when all seven children were living under the same roof – their ages were too far apart.
But, in 2007, Jennifer, one of Marise's eldest children, died of unknown causes just before Joseph's 16th birthday. The family was set adrift, but they were adrift together. Those wounds never fully heal, but as a family they forged ahead.
After more than 40 years in America, a lifetime, José finally decided to get his citizenship. But once again we ask: why now?
"It started to become a pain in the ass," said José. "You renew it every 10 years and I didn't want to go through the process. And then the laws started to change.
"Trump got into it. I said, 'I don't think I'm any different from anybody else, and he might start picking on it.'"
José felt like he was under President Trump's microscope, and he wanted an insurance policy that he would be able to stay in America with his family. The only way to do that was to become a citizen.
Once again, Brito was pushed into making things official. He didn't feel the need to get married until his mother-in-law made it a sticking-point, and he didn't feel the need to become a citizen until it became imperative that he do so.
Brito went through the typical application process with no real issues to speak of, but he still had to take the test. He hadn't had to study for anything since he got his GED, and so he was a bit intimidated. Brito didn't study the first time he took the test, and he failed. Luckily, you're afforded two chances to pass the test.
I was born here, so I never took that test, but I wanted to know if I would pass. I have a hunch that many people born here wouldn't pass, so I set out to test that, at least on myself. I took the test and scored an 85%. A few questions tripped me up – the number of amendments and James Madison writing the federalist papers, just based on my not-knowing. However, a question that not only tricked me but disturbed me was one asking what Ben Franklin was most famous for, which is a bit subjective. None of the given answers were what I knew him for, so I got it wrong. Apparently, he is known primarily for being a diplomat – go figure.
José didn't like studying, but he knew he had to pass, so he memorized the material and took the test again only to find out it was the same. Needless to say, he passed and was ushered into a small ceremony for himself and the other new citizens.
"To me it was something that I had to do," said Brito. "It was like going to get my license for the first time. But I can say that I was relieved because I wanted to do it just to protect myself, so I did it. I don't think what's going to be the next step, I don't think it's one more. But, that should be it."
José Brito isn't alone. The Washington Post reported that the same year José got his citizenship, the number of people who got their citizenship climbed to the highest it's been in five years. 756,800 people were made citizens in 2018, a figure that's up 16% since 2014. People are being scared into citizenship. People like Brito who were fine with their permanent resident status are starting to conclude that it might not be enough, it might not save them.
In 2018, José Brito became a citizen, an American at last. Did it change him? Did "becoming an American" bestow upon him the gravitas that the President's supporters hold in such high regard?
"No, not really," said Brito. "I'm the same."
Newark Joins the Whiskey Trade: All Points West Distillery
Quarantine and Lexapro

redpajama_set_name: RedPajamaCommonCrawl


Dodge Dakota Dvd Player ~ thank you for visiting our site, this is images about dodge dakota dvd player posted by Maria Rodriquez in Dodge category on Apr 05, 2019. You can also find other images like wiring diagram, sensor location, fuel pump location, starter location, control module location, parts diagram, replacement parts, electrical diagram, repair manuals, engine diagram, engine scheme, wiring harness, fuse box, vacuum diagram, timing belt, timing chain, brakes diagram, transmission diagram, and engine problems.
Descriptions: Rbz Rb Dodge Dakota Dvd Player. For more detail please visit image source : www.car-interface.com.
Descriptions: Quad Core Ghz Cortex A Cpu Jeep Grand Cherokee Touch Screen Radio Gps Bluetooth Navi S Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Descriptions: Img Dodge Dakota Dvd Player. For more detail please visit image source : www.oemradios.com.
Descriptions: Maxresdefault Dodge Dakota Dvd Player. For more detail please visit image source : i.ytimg.com.
Descriptions: Installation Dodge Dakota Dvd Player. For more detail please visit image source : www.radio-upgrade.com.
Descriptions: Fm Am Rds Radio Dodge Ram Pickup Trucks Avenger Caliber Challenger Dakota Radio Gps Bluetooth Car Stereo S Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Descriptions: Cd Radio Mp Bluetooth Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Descriptions: Dodge Dakota Dvd Player. For more detail please visit image source : www.2040-cars.com.
Descriptions: Dodge Dakota P U Durango Aftermarket Radio Upgrade Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Descriptions: Tr B Dodge Durango Bleft Side Angle Dodge Dakota Dvd Player. For more detail please visit image source : image.trucktrend.com.
Descriptions: P Dvd Player For Dodge Ram Pickup Trucks Avenger Caliber Challenger Dakota Durango Aftermarket Radio Upgrade S E Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Descriptions: Product Size Dodge Dakota Durango Hd Touch Screen Car Audio S W Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Descriptions: Dodge Durango Dodge Dakota Dvd Player. For more detail please visit image source : 4x4dakota.org.
Descriptions: Original Radio Stereo Upgrade S E Dodge Dakota Dvd Player. For more detail please visit image source : static.seicane.com.
Many thanks for visiting here. Below is a fantastic image for dodge dakota dvd player. We have been looking for this picture through on-line and it originated from trustworthy resource. If you would like for any new ideas for your wiring diagram then the dodge dakota dvd player photo should be on the top of reference or else you may use it for an alternative idea.
This picture has been added by Maria Rodriquez tagged in category field. And we believe it could be the most well liked vote in google vote or event in facebook share. We hope you like it as we do. Please publish this dodge dakota dvd player photo to your buddies, family through google plus, facebook, twitter, instagram or any other social media site.
#honda dvd player.#lexus dvd player.#best car dvd player.#chevy dvd player.#jeep dvd player.#vertical dvd player.#mopar dvd player.#sony dvd player.#2006 chevrolet traverse dvd player.#dodge durango.#dodge grand caravan.#dodge stereo.#chevrolet traverse dvd player.#2005 dodge magnum.#dvd player white.#upright dvd player.#dodge game.#dodge grand caravan dvd player.#mini dvd player.#samsung dvd player.#dodge grill.#car dvd player.#rv dvd player.#2003 dodge grand caravan.#kawasaki dvd player.#daewoo dvd player.#overhead dvd player.#cd dvd player.#dodge caravan dvd player.#lincoln dvd player.#overhead dvd players for trucks.#dodge radio.#toyota dvd player.#fog lights dodge.#1998 dodge durango slt.#jensen dvd player.#dodge overhead dvd player.#2003 dodge durango.#dodge speakers.#dodge ram dvd player.#dodge cd player.#headrest dvd players.#2012 dodge journey.#dvd player for truck.


text:
.class Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3$1;
.super Ljava/lang/Object;
.source "BluetoothMapEmailSettingsAdapter.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;->onCheckedChanged(Landroid/widget/CompoundButton;Z)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$1:Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;

# direct methods
.method constructor <init>(Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;)V
    .locals 0

    .prologue
    .line 274
    iput-object p1, p0, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3$1;->this$1:Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 2

    .prologue
    .line 277
    iget-object v0, p0, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3$1;->this$1:Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;

    iget-object v0, v0, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;->this$0:Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;

    # getter for: Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;->mCheckAll:Z
    invoke-static {v0}, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;->access$700(Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 278
    iget-object v0, p0, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3$1;->this$1:Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;

    iget-object v0, v0, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter$3;->this$0:Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;

    const/4 v1, 0x1

    # setter for: Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;->mCheckAll:Z
    invoke-static {v0, v1}, Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;->access$702(Lcom/android/bluetooth/map/BluetoothMapEmailSettingsAdapter;Z)Z

    .line 279
    :cond_0
    return-void
.end method