Comments (4)
Похоже на баг в компиляторе (вернее даже не столько баг, сколько побочный эффект оптимизатора), как это ни смешно. Как замена в строчке "storage.count(id)" может влиять на строчку "auto wrapper = &storage, callback, id {}" ?
map<ident_t, shared_ptr<Realplexor::Event::ITimer>> storage;
public:
CleanupTimers() {}
template<typename Cb>
void start_timer_for_id(ident_t id, int timeout, Cb callback)
{
// Remove current timer if present.
if (storage.count(id)) {
storage[id]->remove();
storage.erase(id);
}
// Create new timer.
auto wrapper = [&storage, callback, id](int) {
auto guard = storage[id];
storage.erase(id); // thanks to guard, the timer is deleted only when we exit this closure
callback(); // it is important for logs to call erase() before the callback
};
storage[id].reset(new Realplexor::Event::Timer<decltype(wrapper)>(wrapper));
storage[id]->start(timeout);
}
Вот я нашел насчет этого: http://gcc.gnu.org/ml/gcc-help/2012-02/msg00203.html
Попробуйте сделать, как там написано, т.е. заменить на
auto wrapper = [this, callback, id](int) {
Первую строчку, где storage.count(id), не меняйте - с ней все в порядке, нет смысла добавлять там "this->".
Если получится, сделайте pull request, я вмерджу. Спасибо!
from dklab_realplexor.
auto wrapper = [this, callback, id](int) {
дает
Storage/CleanupTimers.h: In lambda function:
Storage/CleanupTimers.h:32:36: error: no match for 'operator[]' in '((Storage::CleanupTimers*)this)->Storage::CleanupTimers::storage[id]'
Проще всего Вам попробовать собрать с последними версиями пакетов, как видно из тредов это не изолированные проблемы, а изменившееся поведение gcc
from dklab_realplexor.
Timosha@a4baf8f и Timosha@b8bd2b7 позволяют собрать для gcc 4.7.2, после выхода 4.7.3 второе изменение можно убрать
from dklab_realplexor.
Данные коммиты вмерджены в основную ветку.
from dklab_realplexor.
Related Issues (20)
- uncaught exception: Error: Permission denied for <http://rpl.host> to get property Proxy.InstallTrigger HOT 4
- поведение при разрыве интернет соединения
- С++ версия сервера. Не полностью отдаёт HTML для IFRAME.. HOT 16
- Проблема при компиляции cpp версии HOT 1
- Не собирается cpp версия на debian sid HOT 14
- проблема с получением сообщений, отправленных одновременно в разные каналы HOT 17
- Send через javascript HOT 1
- 502 Bad Gateway через 21s HOT 1
- OS X installation HOT 2
- Сервер отправляет оборваные ответы HOT 3
- Опера 12.16 HOT 2
- Игнорируется JS_MAX_BOUNCES HOT 3
- Few first messages do not arrive when there is more then 300 connections HOT 4
- Don`t build in OSX Yosemite HOT 1
- Ошибка при компилировании HOT 6
- Баг Dklab realplexor JS API HOT 1
- Почему не запускается dklab_realplexor?
- Cannot compile C++ version (ignoring return value of ‘int setegid(__gid_t)’, declared with attribute warn_unused_result) HOT 1
- Blocked a frame in Google Chrome
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dklab_realplexor.