Developer FAQs

Developer Questions And Answers

×
MENU
  • Languages
  • Web
  • Database
Hometemporary-objectsPosts
How to implement thread-safe container with natural syntactic sugar? Languages

How to implement thread-safe container with natural syntactic sugar?

Below code results in undefined behaviour, if used as is:Traditional approach is to fix it with std::mutex:
14 hours before 发表评论
Read More
Is temporary object originally const? Languages

Is temporary object originally const?

Is this code UB?In other words, is the (temporary) object originally const? I've looked through the standard but cannot find an answer so would appreciate quotations to relevant sections.
01月25日 发表评论
Read More
Range-based for loop on a temporary range [duplicate] Languages

Range-based for loop on a temporary range [duplicate]

This question already has an answer here:Thanks to some segmentation faults and warnings in valgrind, I found that this code is incorrect and has some sort of dangling reference in the for-range loop.
07月25日 发表评论
Read More
Copyright ©  Developerfaqs  All Rights Reserved.

登录 找回密码

输入用户名或电子邮箱地址,您会收到一封新密码链接的电子邮件。

  • 文章目录
  • icon