Skip to main content
1 vote
1 answer
199 views

This is a follow-up of my answer to a question about initialization of arrays of non-default constructible types. The core of the question can be summarized to this snippet, which is an over-...
Oersted's user avatar
  • 3,732
2 votes
1 answer
236 views

The following integer power function returns 0 when the result should be greater than 2^32 if the base argument is unsigned int, but works fine when the base argument type is changed to an unsigned ...
user31597808's user avatar
4 votes
1 answer
198 views

The problem Using static_assert to generate compile-time error is not always easy because it requires a constant expression as first argument. I found, on StackOverflow, several example where throw ...
Oersted's user avatar
  • 3,732
2 votes
2 answers
108 views

I am trying to reproduce constexpr example from Stroustrup book "The C++ Programming Language" 4th Ed, pp. 265-266. I am using Visual Studio 2022 Community. The code below does not compile, ...
AR-47's user avatar
  • 23
1 vote
3 answers
284 views

Ok, I completely messed up this question, first for the typo and second because my oversimplified minimum example didn't have any problem at all. I was considering to delete the question but seeing ...
PaperBirdMaster's user avatar
0 votes
1 answer
88 views

Background Pointers cannot be used as T* p value parameters to a template (which is specialized at compile time), because the memory address &obj of some object T obj is only known at run time. ...
vohir's user avatar
  • 23
9 votes
2 answers
1k views

The wording of the question title is probably incorrect and I'll fix it happily from your suggestions. My question can be illustrated by this snippet: #include <array> template <typename ...
Oersted's user avatar
  • 3,732
0 votes
1 answer
172 views

[dcl.constexpr]/1: The constexpr specifier shall be applied only to the definition of a variable or variable template or the declaration of a function or function template. The consteval specifier ...
John Kalane's user avatar
  • 1,195

15 30 50 per page
1
2 3 4 5