Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix older msvc(19.36) compilation error #91

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

toge
Copy link
Contributor

@toge toge commented Apr 23, 2024

In 0.8.0.0 and 0.9.0, I met a compilation error on older msvc(19.36) followings:

include\rfl\parsing\NamedTupleParser.hpp(99,51): error C2653: 'T': is not a class or namespace name [test_package.vcxproj]
include\rfl\parsing\NamedTupleParser.hpp(90,23): message : This diagnostic occurred in the compiler generated function 'rfl::parsing::schema::Type rfl::parsing::NamedTupleParser<R,W,_ignore_empty_containers,_all_required,FieldTypes...>::to_schema(std::map<std::string,rfl::parsing::schema::Type,std::less<std::string>,std::allocator<std::pair<const std::string,rfl::parsing::schema::Type>>> 

I confirmed it is caused by the line in NamedTupleParser.hpp.

using F = std::tuple_element_t<_i, typename T::Fields>;

This PR try to fix this compilation error.

Please review and merge it if possible.

@liuzicheng1987
Copy link
Contributor

Cool, thank you so much.

@liuzicheng1987
Copy link
Contributor

@toge the code changes look good, of course, and the Github Actions pipelines run through as well. So I am going to merge this. Thank you so much for your contribution!

It is really weird, though, that this should be a problem in the first place...

@liuzicheng1987 liuzicheng1987 merged commit bb3dc34 into getml:main Apr 23, 2024
4 checks passed
@stan1334
Copy link

stan1334 commented Sep 2, 2024

parentcmakefile:
add_subdirectory(reflect-cpp) # Add this project as a subdirectory

set(REFLECTCPP_BSON OFF) # Optional
set(REFLECTCPP_CBOR OFF) # Optional
set(REFLECTCPP_FLEXBUFFERS OFF) # Optional
set(REFLECTCPP_MSGPACK OFF) # Optional
set(REFLECTCPP_TOML OFF) # Optional
set(REFLECTCPP_XML OFF) # Optional
set(REFLECTCPP_YAML OFF) # Optional

add_executable(${PROJECT_NAME}
${HEADER_FILES}
${SOURCE_FILES}
)

target_link_libraries(${PROJECT_NAME}
PRIVATE
reflectcpp
) # Link against the library

cl.exe 19.29.30148.0

builderror:

[build] D:\repos\integrate\src\datalog\src\tools\examples\reflect-cpp\include\rfl\parsing\NamedTupleParser.hpp(201): error C2653: 'F': is not a class or namespace name
[build] D:\repos\integrate\src\datalog\src\tools\examples\reflect-cpp\include\rfl\parsing\NamedTupleParser.hpp(192): note: This diagnostic occurred in the compiler generated function 'void rfl::parsing::NamedTupleParser<R,W,_ignore_empty_containers,_all_required,_no_field_names,ProcessorsType,FieldTypes...>::build_schema(std::map<std::string,rfl::parsing::schema::Type,std::lessstd::string,std::allocator<std::pair<const std::string,rfl::parsing::schema::Type>>> *,conditional<_no_field_names,rfl::parsing::schema::Type::Tuple,rfl::parsing::schema::Type::Object>::type *,std::integer_sequence<int,_is...>) noexcept'
[build] D:\repos\integrate\src\datalog\src\tools\examples\reflect-cpp\include\rfl\parsing\NamedTupleParser.hpp(283): note: see reference to class template instantiation 'rfl::parsing::NamedTupleParser<R,W,_ignore_empty_containers,_all_required,_no_field_names,ProcessorsType,FieldTypes...>' being compiled
[build] ninja: build stopped: subcommand failed.

reflect-cpp版本0.12.0

@liuzicheng1987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants