Skip to content

Compilation error caused by FeatureBase::end() of type nullptr_t #11

@byjtew

Description

@byjtew

Hello !

Tested on .gol files generated from .osm.pbf (switzerland and colorado) using a simple gol build command. I can provide them if necessary.

To reproduce:

#include <geodesk/geodesk.h>
#include <algorithm>

using namespace geodesk;

int main(int argc, char** argv)
{
    if (argc < 2)
    {
        std::cerr << "Usage: " << argv[0] << " <path/to/file.gol>" << std::endl;
        std::abort();
    }

    Features world(argv[1]);

    // Basic example, more generally any STL algorithm (including ranges namespace-d) will fail to compile.
    bool unused = std::any_of(world.begin(), world.end(), [](const auto& each) { return false; });

    return 0;
}

While I understand the convenience of using nullptr_t it actually forbids usage of range based functions like STLs 😕

Environments tested:

  • Windows 10 & MSVC 14.43.34808
  • macOS 15.3.2 & Apple clang 17.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions