std::experimental has not been declared
时间: 2024-02-03 22:12:36 浏览: 26
The error message "std::experimental has not been declared" usually occurs when you try to use a feature from the experimental namespace in C++ without including the appropriate header file.
In C++, the experimental namespace is used for features that are still under development and may not be included in the standard library yet. To use these features, you need to include the appropriate header file that declares the experimental namespace.
For example, if you want to use the experimental::filesystem feature, you need to include the <experimental/filesystem> header file:
```cpp
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
```
Make sure that your compiler supports the experimental features and that you have included the correct header file for the feature you want to use.