boostorg / boostorg/hana

some compile error when I use msvc2022

Open
#516 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

when i use vs2022, Something went wrong! when I define hana struct like this:
```
struct Person {
BOOST_HANA_DEFINE_STRUCT(Person,
(std::string, name),
(unsigned short, age)
);

Person john{ "John", 30 };
boost::hana::find(john, BOOST_HANA_STRING("name")) == boost::hana::just("John");
};
```

Error !!
`
1>F:\boost_1_81_0\boost\hana\traits.hpp(71,80): error C4996: 'std::is_pod': warning STL4025: std::is_pod and std::is_pod_v are deprecated in C++20. The std::is_trivially_copyable and/or std::is_standard_layout traits likely suit your use case. You can define _SILENCE_CXX20_IS_POD_DEPRECATION_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,89): error C2039: 'is_literal_type': is not a member of 'std'
1>D:\vs2022\Community\VC\Tools\MSVC\14.29.30133\include\iostream(19): message : see declaration of 'std'
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,104): error C3536: 'boost::hana::traits::is_literal_type': cannot be used before it is initialized
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,104): error C3200: 'int': invalid template argument for template parameter 'F', expected a class template
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,105): error C3200: 'int': invalid template argument for template parameter 'F', expected a class template
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,105): error C2641: cannot deduce template arguments for 'boost::hana::traits::detail::hana_trait'
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,105): error C2783: 'boost::hana::traits::detail::hana_trait boost::hana::traits::detail::hana_trait(void)': could not deduce template argument for 'F'
1>F:\boost_1_81_0\boost\hana\traits.hpp(27): message : see declaration of 'boost::hana::traits::detail::hana_trait'
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,106): error C2780: 'boost::hana::traits::detail::hana_trait boost::hana::traits::detail::hana_trait(boost::hana::traits::detail::hana_trait)': expects 1 arguments - 0 provided
1>F:\boost_1_81_0\boost\hana\traits.hpp(27): message : see declaration of 'boost::hana::traits::detail::hana_trait'
1>F:\boost_1_81_0\boost\hana\traits.hpp(74,47): error C2737: 'boost::hana::traits::is_literal_type': constexpr object must be initialized
1>G:\git\ConsoleApplication6\ConsoleApplication6.cpp(29,18): error C2078: too many initializers
`

What can I do for this??

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the report with VS2022/MSVC 14.29.30133 and inspect boost/hana/traits.hpp around lines 71 and 74, where the deprecated or missing standard traits are diagnosed. Compare the reported sample and compiler errors with the supported C++ configuration; done means establishing a confirmed compatibility fix or clearly documenting the required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.