'auto' and const references113 (5/3/2013 1:16:37 PM) comp.lang.c++ Let's say that a function returns a const reference. If I say this:
auto x = thatFunction();
what would the type of 'x' be? Will it be a const reference, thus
eliding copying, or will a copy be made?
... Juha
Can a temporary be assigned to itself?2513 (3/22/2013 9:05:54 AM) comp.lang.c++ If you are implementing the regular operator=() for a class, you (usually)
need to take into account the special case that the same object is being
assigned to itself. (If you don't, you may end up deleting t... Juha
constexpr static member function513 (3/1/2013 4:19:34 PM) comp.lang.c++ For some reason this doesn't compile with the latest clang:
class MyClass
{
public:
static constexpr int something(int);
};
constexpr int MyClass::something(int i) { retur... Juha
Multiple parameter packs in function parameters920 (11/30/2012 11:28:07 AM) comp.lang.c++ Is this valid code, or should it even compile?
template
void func(Pack1... pack1, Pack2... pack2) {}
Currently the behavior of that seems quite erratic in different compilers.
In gcc you can t... Juha
Template argument as rvalue reference1329 (10/26/2012 10:23:15 AM) comp.lang.c++ There's a special rule in the new standard with regard to rvalue references
when used with a template argument. Namely, if you have T&& (where T is
a template argument), it will be collapsed to T& if an lvalu... Juha
Overloaded function dilemma929 (10/16/2012 7:16:36 AM) comp.lang.c++ For a series of classes I'm making it would be nice if they had constructors
that accept:
- an interator range,
- an initializer list, and
- a variable amount of arguments (using a variadic template)
T... Juha
Compile-time integer arithmetic without using templates027 (10/3/2012 6:30:16 PM) comp.lang.c++ I think the new 'constexpr' keyword is actually quite cool. For example
this calculates the integral square root of an integer, rounded up, at
compile time.
//----------------------------------------------... Juha
Initializing std::array1533 (9/11/2012 4:03:02 PM) comp.lang.c++ How to properly initialize a std::array, 2> using
an initializer list?
... Juha
Giving an rvalue ref to a function taking an rvalue ref1828 (8/20/2012 10:29:58 AM) comp.lang.c++ Suppose you have a function that takes an rvalue reference as parameter,
and from within it you want to call another function that likewise takes
one, but there's also a version of that function that takes a ... Juha
The design of LLVM138 (5/31/2012 6:54:29 AM) comp.lang.c++ Please don't shoot me for posting something that's not 100% on-topic, but
I found this article on the design of LLVM to be interesting:
http://www.drdobbs.com/architecture-and-design/240001128
... Juha
C++14: Papers19017 (4/5/2013 8:40:31 PM) comp.lang.c++ Here are three links which showcase which features are being proposed for
C++14:
http://www.meetingcpp.com/index.php/br/items/a-look-at-cpp14-papers-
part-1.html
http://www.meetingcpp.com/index.php/br/it... rui.maciel(1746)
C++ rounds up my decimals1113 (4/10/2013 2:32:17 AM) comp.lang.c++ Hi I made this code:
#include
#include
using namespace std;
int main() {
int getIntx()
unsigned int ans;
double mfirstnum, msecondnum;
cout > x)) {
cin.clear();
cin.ignore(numeric_limits::m... techgeek201(57)
Dear Human !!!!!!!!!!!!!!5610 (4/20/2013 7:11:41 PM) comp.lang.c++ Dear Human!
The lecturer says at the beginning of the video, "I am talking to
you as a human; it does not matter whether you are Christian, Jew,
Buddhist or Hindu. It does not matter whether you are a wors... bv8bv8bv8(251)
fixing absence of operator[] and at in list97 (4/22/2013 12:28:04 AM) comp.lang.c++ I have been wanting to use a container with efficient inserts and deletes i=
n the middle. Hence it seems list is my choice. But I also require indexed =
access which list doesn't provide. Hence I thought of ... samjnaa(27)
const local vs. member176 (4/25/2013 11:43:31 AM) comp.lang.c++ hello group,
what do you think/know is faster:
Matrix& Matrix::Translate(GLfloat x, GLfloat y, GLfloat z)
{
const std::array translate =
{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0... 4one(114)
Seek for help..linked list..urgent!!!23 (5/12/2013 9:11:38 AM) comp.lang.c++ I 'm C++ programming beginner..I need someone help me ..
There is error "expected primary-expression before "template""..I 'm really don't know how to fix it..my compiler is Dev C++..pls giv me a favor..
Than... mfongthong(1)
Overloading string literal132 (5/12/2013 2:50:57 PM) comp.lang.c++ Suppose: int Buffer::Put(const char *s);
Where: Put() has to find the length of 's' by strlen().
I would like to have: Put("Header Tag...") where sizeof("Header Tag...") -
1 is known at compile-time.
Macro... q3k(2)
can't convert from type A* to type B*44 (5/17/2013 3:43:28 AM) comp.lang.c++ I need to change DMapEntry::pData from a char* to a class DMapData that contains the original pointer but still be able to refer to &pData[offset] in DMapEntry without changing it. Is this possible?
#include... carl.eichert(1)