While writing a clang plugin, I noticed that objects of type llvm::cl::opt<T> are not convertible to std::any, i.e. the following snippet does not compile:
#include <any> #include <string> #include "llvm/Support/CommandLine.h" int main() { llvm::cl::opt<std::string> opt("o"); std::any opt_any = opt; // doesn't work! } I would like to know both why this isn't possible in this specific instance and what criteria a type has to fullfill in general in order to be convertible to std::any.