Description:
Discussion about C++ language, library, standards. (Moderated)
|
|
|
Getting derived class pointer from the base class via CRTP
|
| |
Hi,
I am having to make my base class a template because I want a function in it that the users can call to get pointer to the derived class (or that my own template library can call to get pointer to the derived class). I do it by making my base class a curious base. Now users just pass their derived classes as template parameters to my base class that enables my library to run correctly as it can get the derived class pointer. But that's the only use of CRTP in my library. Can you recommend any other clean alternatives?... more »
|
|
N3417: Proposal for Unbounded-Precision Integer Types
|
| |
What should be the result of unsigned_integer(-1) ?
Helmut
--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp-sub...@vandevoo rde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: [link] ]... more »
|
|
Sequence container capacity after calling clear()
|
| |
Hi,
Can we please change the ISO C++ Standard so that explicitly states what
happens to a sequence container's capacity() after calling clear()?
Currently the behaviour is unspecified and I know of at least one
implementation that deallocates on vector<T>::clear().
If the behaviour remains unspecified then it is effectively impossible... more »
|
|
Using temporary string in regex_match
|
| |
...
I would expect the documentation of regex_match and smatch to reflect
that. And indeed the C++11 standard library says that an smatch is an
alias for match_results<string::const_it erator> storing a couple of
sub_match<string::const_iterat or> objects that are simply pairs of
iterators with a couple of extra methods.... more »
|
|
C++11 – Enumeration Aliasing
|
| |
Recently I've been using C++11 enumerations to provide a byte pointer with
stronger strict-aliasing properties. Specifically, I've been using the
definition:
enum byte : uint8_t {};
My reading of the strict-aliasing rules supports the behaviour modern compilers
exhibit in this regard; specifically, byte* aliases only other byte pointers and... more »
|
|
detecting incomplete type
|
| |
What is a standard way to tell whether a type is complete or not? In a
way usable in say static_assert?
In boost code I saw sizeof(T) used that worked fine on gcc and msvc
which make that 0. But I recently read the section on sizeof that
tells it used with incomplete type makes the program ill-formed.... more »
|
|
Could we use T:X to abbreviate "typename T::X"? (and get cleaner code)
|
| |
When I use constructs like std::enable_if my code gets polluted with many typenames, as in
typename std::enable_if< std::is_same<typename A::X, typename B::Y>::value,
typename C::Z>::type
Would it be too costly to introduce a symbol, say ':', in the language so
that "T:X" is an abbreviation for "typename T::X"?... more »
|
|
Variadic template parameter pack matching non-pack parameters
|
| |
[To the moderators: this is my second attempt, the first one posted
using Google Groups went into the void. Also, a mail to
std-c++-requ...@cs.rpi.edu was being rejected because "User address is
not valid"]
I was playing around with the November '12 CTP preview of the VC++11
compiler, which includes an implementation of variadic templates, and... more »
|
|
Inheritance of constructor/desctructor
|
| |
Hi,
I have a question about definition of inheritance (perhaps as stated in C++
ISO docs somewhere).
Somebody claimed that when one class is derived from another, then the base
class' constructors and desctructors are inherited by the derived class.
Let's consider the simplest case:
class Base {};... more »
|
|
|