Skip to content

Commit

Permalink
Expand repro
Browse files Browse the repository at this point in the history
  • Loading branch information
playmer committed Apr 27, 2018
1 parent fc95aa8 commit 7c1bb5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,5 @@ $RECYCLE.BIN/
*.db
*.db-shm
*.db-wal

*.exe
27 changes: 15 additions & 12 deletions Reflection/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,21 @@ namespace YTE
Unknown
};


static XboxController* STATIC_GetXboxController(ControllerId aId)
{
return nullptr;
}

class GamepadSystem
{
public:
YTEDeclareType(GamepadSystem);
XboxController* GetXboxControllerConst(ControllerId aId) const
{
return nullptr;
}

XboxController* GetXboxController(ControllerId aId)
{
return nullptr;
Expand All @@ -37,10 +48,6 @@ namespace YTE
YTEDefineType(GamepadSystem)
{
YTERegisterType(GamepadSystem);
//auto size = CountFunctionArguments<decltype(&GamepadSystem::GetXboxController)>::template Size();

//YTEBindFunction(&GamepadSystem::GetXboxController, YTENoOverload, "GetXboxController", YTEParameterNames("aController")).Description()
// = "Gets you the given controller. Warning: Controller may not be plugged in/active.";
}
}

Expand All @@ -49,16 +56,12 @@ YTEDeclareExternalType(YTE::ControllerId);
YTEDefineExternalType(YTE::ControllerId)
{
YTERegisterType(YTE::ControllerId);

// YTEBindEnumValue(ControllerId::Xbox_P1, "Xbox_P1");
// YTEBindEnumValue(ControllerId::Xbox_P2, "Xbox_P2");
// YTEBindEnumValue(ControllerId::Xbox_P3, "Xbox_P3");
// YTEBindEnumValue(ControllerId::Xbox_P4, "Xbox_P4");
// YTEBindEnumValue(ControllerId::Xbox_Controllers_Number, "Xbox_Controllers_Number");
// YTEBindEnumValue(ControllerId::Unknown, "Unknown");
}

int main()
{
auto caller = YTE::Binding<decltype(&YTE::GamepadSystem::GetXboxController)>::template Caller<&YTE::GamepadSystem::GetXboxController>;
// These will all ICE.
auto caller1 = YTE::Binding<decltype(&YTE::STATIC_GetXboxController)>::template Caller<&YTE::STATIC_GetXboxController>;
auto caller2 = YTE::Binding<decltype(&YTE::GamepadSystem::GetXboxControllerConst)>::template Caller<&YTE::GamepadSystem::GetXboxControllerConst>;
auto caller3 = YTE::Binding<decltype(&YTE::GamepadSystem::GetXboxController)>::template Caller<&YTE::GamepadSystem::GetXboxController>;
}

0 comments on commit 7c1bb5c

Please sign in to comment.