Here, static_cast is a keyword, so it doesn't belong to the std namespace. That's why the error is showing expected unqualified-id before 'static_cast'.
In simpler terms, you're using an identifier std::static_cast that doesn't exist.
The std:: namespace is used to qualify identifiers within the C++ Standard Library (like std::vector, std::copy, etc.).
See more about scope resolution operator https://www.ibm.com/docs/en/i/7.3?topic=expressions-scope-resolution-operator-c-only
See How do you properly use namespaces in C++? for use of namespaces generally.