Closed NoAvailableAlias closed 9 years ago
I will have a look, but I have to install VS 2015 RC
first...
Wouldn't be surprised if it was a vs bug or something non-standard that vs chokes on. Just including signal.hpp with an empty main is enough to elicit an impressive error list.
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(53): error C2433: 'connection': 'inline' not permitted on data declarations
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(53): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(53): error C2061: syntax error: identifier 'connect'
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(107): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(115): error C2988: unrecognizable template declaration/definition
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(115): error C2059: syntax error: 'for'
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(115): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(127): error C2143: syntax error: missing ')' before ';'
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(127): error C2988: unrecognizable template declaration/definition
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(127): error C2059: syntax error: ')'
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(131): error C2988: unrecognizable template declaration/definition
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(131): error C2143: syntax error: missing ';' before '<'
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(131): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\projects\staging\kosta-github\signals-cpp\signals-cpp\connections.hpp(131): error C2238: unexpected token(s) preceding ';'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(22): error C2143: syntax error: missing ';' before 'identifier'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(22): warning C4091: 'typedef ': ignored on left of 'std::memory_order' when no variable is declared
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(25): error C2146: syntax error: missing ';' before identifier '_Atomic_integral_t'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(55): error C2146: syntax error: missing ';' before identifier '_Atomic_load_4'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(55): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(55): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(55): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(57): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(57): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(57): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(58): error C2146: syntax error: missing ';' before identifier '_Atomic_fetch_add_4'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(59): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(59): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(59): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(60): error C2146: syntax error: missing ';' before identifier '_Atomic_fetch_sub_4'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(61): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(61): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(61): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(63): error C2146: syntax error: missing ';' before identifier '_Atomic_counter_t'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(67): error C2146: syntax error: missing ';' before identifier '_Get_atomic_count'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(67): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(67): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(67): error C2143: syntax error: missing ',' before '&'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(68): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(69): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(72): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(72): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(73): error C2065: '_Atomic_integral_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(73): error C2146: syntax error: missing ')' before identifier '_Value'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(74): error C2143: syntax error: missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(74): error C2447: '{': missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(78): error C2146: syntax error: missing ';' before identifier '_Inc_atomic_counter_explicit'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(79): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(79): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(79): error C2955: 'std::memory_order': use of class template requires template argument list
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(15): note: see declaration of 'std::memory_order'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(79): error C2146: syntax error: missing ')' before identifier '_Order'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(80): error C2143: syntax error: missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(80): error C2447: '{': missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(84): error C2146: syntax error: missing ';' before identifier '_Inc_atomic_counter'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(84): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(84): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(84): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(85): error C2448: 'std::_Inc_atomic_counter': function-style initializer appears to be a function definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(89): error C2146: syntax error: missing ';' before identifier '_Dec_atomic_counter_explicit'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(90): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(90): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(90): error C2955: 'std::memory_order': use of class template requires template argument list
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(15): note: see declaration of 'std::memory_order'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(90): error C2146: syntax error: missing ')' before identifier '_Order'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(91): error C2143: syntax error: missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(91): error C2447: '{': missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(95): error C2146: syntax error: missing ';' before identifier '_Dec_atomic_counter'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(95): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(95): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(95): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(96): error C2448: 'std::_Dec_atomic_counter': function-style initializer appears to be a function definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(100): error C2146: syntax error: missing ';' before identifier '_Load_atomic_counter_explicit'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(101): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(101): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(101): error C2955: 'std::memory_order': use of class template requires template argument list
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(15): note: see declaration of 'std::memory_order'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(101): error C2146: syntax error: missing ')' before identifier '_Order'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(102): error C2143: syntax error: missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(102): error C2447: '{': missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(106): error C2146: syntax error: missing ';' before identifier '_Load_atomic_counter'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(106): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(106): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(106): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(107): error C2448: 'std::_Load_atomic_counter': function-style initializer appears to be a function definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(111): error C2146: syntax error: missing ';' before identifier '_Compare_increment_atomic_counter_explicit'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(112): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(112): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(113): error C2065: '_Atomic_integral_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(113): error C2146: syntax error: missing ')' before identifier '_Expected'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(115): error C2143: syntax error: missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(115): error C2447: '{': missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(121): error C2146: syntax error: missing ';' before identifier '_Compare_increment_atomic_counter'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(122): error C2065: '_Atomic_counter_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(122): error C2065: '_Counter': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(122): error C2065: '_Atomic_integral_t': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(122): error C2146: syntax error: missing ')' before identifier '_Expected'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(123): error C2143: syntax error: missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xatomic0.h(123): error C2447: '{': missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\setjmp.h(44): error C2143: syntax error: missing ';' before 'identifier'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\setjmp.h(44): warning C4091: 'typedef ': ignored on left of '__JUMP_BUFFER' when no variable is declared
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\setjmp.h(158): error C2065: 'jmp_buf': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\setjmp.h(159): error C2146: syntax error: missing ')' before identifier '_Buf'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\setjmp.h(165): error C2065: 'jmp_buf': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\setjmp.h(165): error C2146: syntax error: missing ')' before identifier '_Buf'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\mmintrin.h(45): error C2143: syntax error: missing ';' before 'identifier'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\mmintrin.h(45): warning C4091: 'typedef ': ignored on left of '__m64' when no variable is declared
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(75): error C2143: syntax error: missing ';' before 'identifier'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(75): warning C4091: 'typedef ': ignored on left of '__m128' when no variable is declared
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(44): error C2143: syntax error: missing ';' before 'identifier'
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(44): warning C4091: 'typedef ': ignored on left of '_heapinfo' when no variable is declared
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(61): error C2065: '_HEAPINFO': undeclared identifier
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(61): error C2065: '_EntryInfo': undeclared identifier
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(61): warning C4229: anachronism used: modifiers on data are ignored
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(61): error C2491: '_heapwalk': definition of dllimport data not allowed
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(149): error C2065: '_Marker': undeclared identifier
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(150): error C2065: '_Marker': undeclared identifier
1>c:\program files (x86)\windows kits\10\include\10.0.10056.0\ucrt\malloc.h(155): error C2065: '_Marker': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(389): error C2526: '_mm_cvtpi16_ps': C linkage function cannot return C++ class '__m128'
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(65): note: see declaration of '__m128'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(391): error C3861: '_mm_setzero_si64': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(391): error C3861: '_m_pcmpgtw': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(393): error C2065: '_Tmp': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmmintrin.h(393): fatal error C1003: error count exceeds 100; stopping compilation
I think I fixed that issue; it compiles for me with VS 2015 RC
now.
Please use this single include for pulling in the library headers:
#include <signals-cpp/signals.hpp>
@NoAvailableAlias Would love to here the results of the performance comparisons... :-)
I had to change signal.hpp lines 144 and 152 due to ARGS = Rng&
cannot be bound to ARGS const&
. But now signals-cpp compiles. I did try to run the benchmarks this morning before work, however, now signals-cpp does not pass the validation test.
This algorithm creates a subject, creates an array of observers, connects each observer to the subject, performs an emission, disconnects each observer from the subject, then tries to perform an emission again (there should be no connected observers at this point).
The usual culprit that fails this test is whenever the observer array is destructed on line 37 as destruction should disconnect from the subject. Following this on line 39 an emission is made that should be an empty emission. If it is not empty then there is an error in the implementation and will be detected due to the prng
state being changed.
Issue fixed by this submission: https://github.com/Kosta-Github/signals-cpp/commit/4eb308a8a21ec921b25dd3b58ffba1900e16197c
The problem with your change was that passing in the arguments via ARGS... args
will create a copy of the passed in object instead of keeping the reference; I have changed that to use the forwarding/universal references instead ARGS&&... args
together with corresponding forwarders std::forward<ARGS>(args)...
.
I ran your test suite (only for my lib) and it works in DEBUG
mode without assertions. Maybe you can provide the VS 2015
project file in your GIT repo as well, which would make it easier to get started with that project?
Now I am curious about the performance numbers... :-)
Hmm, I would have thought that ARGS
will be bound to whatever is provided to the signal template in this case being std::minstd_rand&
. I will pull the changes and try again after work today.
Changes have indeed fixed the issue. Here are the results:
+-----------------------+------------+-----------+----------+-----------+-----------+---------+
| Library | construct | destruct | connect | emission | combined | total |
|-----------------------+------------+-----------+----------+-----------+-----------+---------|
| jeffomatic jl_signal | 100451 | 16579 | 48720 | 42930 | 11061 | 219740 |
| nano-signal-slot (FT) | 148602 | 12153 | 9304 | 43610 | 5026 | 218696 |
| Wink-Signals | 141163 | 15649 | 8493 | 44580 | 5014 | 214898 |
| Yassi | 140486 | 8136 | 5142 | 43891 | 2916 | 200571 |
| amc522 Signal11 | 117509 | 8185 | 5207 | 40930 | 3024 | 174856 |
| pbhogan Signals | 110944 | 8934 | 5546 | 42738 | 3496 | 171659 |
| mwthinker Signal | 110457 | 8639 | 5415 | 42651 | 3221 | 170383 |
| * fr00b0 nod | 109834 | 9610 | 5928 | 36822 | 3370 | 165564 |
| * Kosta signals-cpp | 125985 | 8363 | 1194 | 20349 | 981 | 156872 |
| joanrieu signal11 | 92931 | 13150 | 6374 | 37465 | 3816 | 153736 |
| EvilTwin Observer | 93885 | 5033 | 2034 | 29866 | 1360 | 132178 |
| supergrover sigslot | 13188 | 2248 | 2767 | 43824 | 1089 | 63116 |
| * winglot Signals | 11886 | 4181 | 4104 | 36554 | 1749 | 58474 |
| * neosigslot | 15651 | 4772 | 3301 | 8700 | 1463 | 33888 |
| Boost Signals | 10207 | 2984 | 912 | 9824 | 609 | 24536 |
| * Boost Signals2 | 8307 | 4534 | 1660 | 7154 | 912 | 22566 |
+-----------------------+------------+-----------+----------+-----------+-----------+---------+
* Library is designed to be thread safe.
thanks for sharing!
Hello, recently I've tried to add signals-cpp to a benchmark of signal slot implementations that I maintain, however, I have run into compiling issues and don't seem to see what the sole cause of the problem is. Here is the project and here is the header where the usage of signals-cpp is contained. I'm pretty sure I'm using signals-cpp correctly, and I haven't ruled out a visual studio bug.
The exact error list: