Код: Выделить всё
`E0493` No instance of overloaded function "UIElement::UIElement" matches the given argument type
`E0757` "Member "UIElement::UIState" " is not a typename
`C2061` Syntaxerror: Type "UIState"
`C2511` UIElement::UIElement(uint16_t): Overloaded memberfunction not found in "UIElement"
Код: Выделить всё
#pragma once
class UIElement
{
public:
struct UIState {
bool enabled = false;
bool visible = false;
};
UIElement(
UIState UIState_in
/*other inputs*/);
// ...
UIState UIState; // This line is related. If renamed to UIstate, the constructor error goes away
// ...
};
Код: Выделить всё
#include "UIElement.h"
#include
UIElement::UIElement(UIElement::UIState UIState_in /*other inputs*/)
{
}
...
< /code>
Ошибка возникает внутри файла .cpp внутри определения конструктора.
Я не знаю, что я делаю неправильно. У меня никогда не было такой проблемы. (Также подозрительно заключается в том, что я получаю синтаксисерр C2061 Я ожидал, что конструктор возьмет uistate uistate_in в качестве типа для in_variable. Ошибки, которые либо in_variable, либо сам конструктор.>
Подробнее здесь: https://stackoverflow.com/questions/796 ... t-take-str
Мобильная версия