-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed as not planned
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Compiling the following scene with Visual Studio 2022, I get a compile error
I used C++17 inline static member variables
file: hello.hpp
#pragma once
#include <vector>
#include <deque>
template <typename T>
class MyQue {
std::deque<T> que_;
};
class A{
inline static MyQue<A> myque_;
};
file hello.cpp
#include "hello.h"
int main() {
A a;
}I found this weird problem with the following scenario
- compile directly (Everything is the default configuration Debug/x64/C++17)
- At this time, an error will be reported, an undefined type is used 'A'
- Change
dequetovector, compile throughstd::deque<T> que_;----->std::vector<T> que_;
I don't understand, why deque doesn't work properly
// in an experiment,If you do not clear the cache at this time and change back to deque, the compilation can still pass.
These codes can be compiled smoothly in linux gcc-9
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists