-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Description / Steps to reproduce the issue
I am new in c++ so this error is for me the end of the way.
I have a class Memory whit a T** emplace(args&&) method
template<typename T, typename... Args>
inline auto emplace(Args&&... args) ;
In class BackgroundComponent<W,H> I need a memory as reference in the constructor so i create a concept and it works
template<typename Memory>
concept MemoryType = requires(Memory a, ASCIIPixelComponent comp) {
{ a.template emplace<ASCIIPixelComponent>(std::move(comp)) }
-> std::convertible_to<ASCIIPixelComponent**>;
};
In other clases i need update this concept for a diferent types any like MemoryType<Comps...> so i do the next concept with chat GPT
template<typename Memory, typename... Comps>
concept MemoryType = (requires(Memory a, Comps comp) {
{ a.template emplace<Comps>(std::move(comp)) } -> std::convertible_to<Comps**>;
} && ...);
i use it in cpp and hpp
template<class Memory>
requires MemoryType<Memory, ASCIIPixelComponent>
BackgroundComponent(Memory* mem,std::array<ASCIIPixelComponent, width*height>&& input);
template<std::size_t width,std::size_t height>
template<class T>
requires MemoryType<T, ASCIIPixelComponent> <-- maybe this redefinition idk is on error
BackgroundComponent<width,height>::BackgroundComponent(T* mem,std::array<ASCIIPixelComponent,width*height>&& input)
: pixels(), Enabled(true){
std::transform(
input.begin(), input.end(), pixels.begin(),
[&](ASCIIPixelComponent& comp) {
return mem->template emplace<ASCIIPixelComponent>(std::move(comp)); <-- maybe this move is on error
}
);
}
and when i use it i get a internal error.. it seems like start cry something abaut a substitution of a template and die
In file included from src/main.cpp:3:
./src/includes/./BackgroundComponent.hpp: In substitution of 'template<class Memory> requires MemoryType<Memory, Engine::ASCIIPixelComponent> Engine::BackgroundComponent<100, 30>::BackgroundComponent(T*, std::array<Engine::ASCIIPixelComponent, 3000>&&) [with Memory = 100]':
src/main.cpp:38:5: required from here
38 | ));
| ^
./src/includes/./BackgroundComponent.hpp:13:7: internal compiler error: in iterative_hash_template_arg, at cp/pt.cc:1769
13 | { a.template emplace<Comps>(std::move(comp)) } -> std::convertible_to<Comps**>;
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
Expected behavior
maybe the use of std::move inside a concept or the reuse?
Actual behavior
Thats the actual behavior
Verification
- I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)
Windows Version
Microsoft Windows [Versión 10.0.26100.6584]
MINGW environments affected
- MINGW64
- MINGW32
- UCRT64
- CLANG64
- CLANGARM64
Are you willing to submit a PR?
No response