source code https://github.com/kennywakeland/Decltype-Bug/blob/master/main.cpp
Test compile https://coliru.stacked-crooked.com/a/443f03625728f00e
This code is to test the setters and getters, using macros. I want to pass in the variable name. decltype is not returning the right type to the HTestSet. Any idea why it is not returning the correct value type ?
Compiler error g++ -std=c++11 -O2 -Wall -pedantic -pthread main.cpp && ./a.out
main.cpp: In function 'int main()':
main.cpp:26:72: error: no matching function for call to 'HTestSet(TestClass&, void (BaseClass::*)(int), int&)'
if(HTestSet(OBGEC_ON, &decltype(OBGEC_ON)::SET_CALL, test_vall_stor)){
^
main.cpp:18:1: note: in expansion of macro 'H_TEST_VALUE_GET_SET'
H_TEST_VALUE_GET_SET(H_GET_VALUE(OBGEC_ON, VAL_NAME), \
^~~~~~~~~~~~~~~~~~~~
main.cpp:92:5: note: in expansion of macro 'H_TEST_VALUE'
H_TEST_VALUE(woo, Green, 3);
^~~~~~~~~~~~
Aucun commentaire:
Enregistrer un commentaire