klaus

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: I get the following compile error #1520

    klaus
    Member

    required change in allocate_free.cpp to avoid compile error: change false to nullptr

    // *********************************************************
    // C++ style and error handling

    *ptr = new (std::nothrow) DataType[size];

    // was: if ((*ptr) == false) { // nullptr
    if ((*ptr) == nullptr) { // nullptr i.e. correction
    LOG_INFO(“Cannot allocate memory”);
    LOG_VERBOSE_INFO(2, “Size of the requested buffer = ” << size*sizeof(DataType));
    FATAL_ERROR(__FILE__, __LINE__);
    }
    // *********************************************************

    Is this approach correct?

Viewing 1 post (of 1 total)