yaml-cpp
yaml-cpp copied to clipboard
[clang-tidy] several const changes
trafficstars
Couldn't figure out how to move the GetStartTokenFor function in the namespace.
What was the problem when trying to move GetStartTokenFor into the cpp file?
src/scanner.cpp:22:69: error: definition of ‘YAML::Token::TYPE YAML::Scanner::GetStartTokenFor(YAML::Scanner::IndentMarker::INDENT_TYPE)’ is not in namespace enclosing ‘YAML::Scanner’ [-fpermissive]
22 | Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
| ^
src/scanner.cpp:22:13: error: no declaration matches ‘YAML::Token::TYPE YAML::Scanner::GetStartTokenFor(YAML::Scanner::IndentMarker::INDENT_TYPE)’
22 | Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
| ^~~~~~~
src/scanner.cpp:22:13: note: no functions named ‘YAML::Token::TYPE YAML::Scanner::GetStartTokenFor(YAML::Scanner::IndentMarker::INDENT_TYPE)’
In file included from src/scanner.cpp:5:
src/scanner.h:30:7: note: ‘class YAML::Scanner’ defined here
30 | class Scanner {
| ^~~~~~~
src/scanner.cpp:22:39: error: ‘struct YAML::Scanner::IndentMarker’ is private within this context
22 | Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
| ^~~~~~~~~~~~
In file included from src/scanner.cpp:5:
src/scanner.h:48:10: note: declared private here
48 | struct IndentMarker {
| ^~~~~~~~~~~~
src/scanner.cpp: In member function ‘YAML::Scanner::IndentMarker* YAML::Scanner::PushIndentTo(int, YAML::Scanner::IndentMarker::INDENT_TYPE)’:
src/scanner.cpp:300:34: error: ‘GetStartTokenFor’ was not declared in this scope
300 | indent.pStartToken = PushToken(GetStartTokenFor(type));
| ^~~~~~~~~~~~~~~~
[5/9] Building CXX object CMakeFiles/yaml-cpp.dir/src/singledocparser.cpp.o
Rebased.