vector-of-bool / cmrc

A Resource Compiler in a Single CMake Script
MIT License
672 stars 74 forks source link

MSVC doesn't compile directory, since it contains a deque of itself #8

Closed Quincunx271 closed 6 years ago

Quincunx271 commented 6 years ago

Currently, directory contains a std::deque<directory> _dirs. This std::deque is instantiated with the incomplete type directory.

class directory {
    std::deque<directory> _dirs;

As far as I can tell, this isn't allowed by the standard, and MSVC rejects it.

The cppreference entry on std::deque seems to imply that it doesn't allow incomplete types, especially when juxtaposed with std::vector. It's not just cppreference, n4659 does the same:

[vector]:

An incomplete type T may be used when instantiating vector if the allocator satisfies the allocator completeness requirements. T shall be complete before any member of the resulting specialization of vector is referenced.

[deque] has no such mention.

vector-of-bool commented 6 years ago

Fixed now.