Re: [Rd] Unexpected behavior when using macro to loop over vector

2019-10-25 Thread Tomas Kalibera
On 10/25/19 5:20 PM, Wang Jiefei wrote: > Thank you, Tomas. I appreciate your help. BTW, could you also add an > explicit type conversion in " ITERATE_BY_REGION_PARTIAL" macro while > you are fixing the bug? C++ compiler does not happy with the implicit > conversion from void* to T* somehow and

Re: [Rd] Unexpected behavior when using macro to loop over vector

2019-10-25 Thread Wang Jiefei
Thank you, Tomas. I appreciate your help. BTW, could you also add an explicit type conversion in " ITERATE_BY_REGION_PARTIAL" macro while you are fixing the bug? C++ compiler does not happy with the implicit conversion from void* to T* somehow and I have to redefine it before using the macro. Best

Re: [Rd] Unexpected behavior when using macro to loop over vector

2019-10-25 Thread Tomas Kalibera
On 10/25/19 11:01 AM, Tomas Kalibera wrote: On 10/23/19 6:45 AM, Wang Jiefei wrote: Hi all, I found an unexpected behavior when I was trying to use the macro defined in "R_ext/Itermacros.h"  to loop over an atomic vector. Here is a minimum example: C++ code ``` #include "R_ext/Itermacros.h"

Re: [Rd] Unexpected behavior when using macro to loop over vector

2019-10-25 Thread Tomas Kalibera
On 10/23/19 6:45 AM, Wang Jiefei wrote: Hi all, I found an unexpected behavior when I was trying to use the macro defined in "R_ext/Itermacros.h" to loop over an atomic vector. Here is a minimum example: C++ code ``` #include "R_ext/Itermacros.h" #define GET_REGION_BUFSIZE 2 //Redefine the mac

[Rd] Unexpected behavior when using macro to loop over vector

2019-10-22 Thread Wang Jiefei
Hi all, I found an unexpected behavior when I was trying to use the macro defined in "R_ext/Itermacros.h" to loop over an atomic vector. Here is a minimum example: C++ code ``` #include "R_ext/Itermacros.h" #define GET_REGION_BUFSIZE 2 //Redefine the macro since C++ is not happy with the implici