Visual Studio C++ 2012 is adding variadic templates

L

Lynn McGuire

Am 11/5/12 11:14 PM, schrieb Lynn McGuire:

Gosh, that was fast.

I mean, we only started to ramble about VC's (non-)support of variadic templates six days ago ...

Stuart

I think that they knew that they were behind
but it is hard to tell what MS thinks. To me,
MS is very fragmented.

Lynn
 
J

Jorgen Grahn

Great, but way lags behind g++. All in all we can get g++ from svn
repository and get new features immediately...

Yes, but if you're writing software which is supposed to work
reliably, that's really of little use. Although it allow you to toy
with and learn new features early.

/Jorgen
 
T

Thomas Richter

Am 06.11.2012 10:57, schrieb Jorgen Grahn:
Yes, but if you're writing software which is supposed to work
reliably, that's really of little use. Although it allow you to toy
with and learn new features early.

Is it? Actually, g++ is here also used for production code - not on the
windows platform, though.
 
M

Melzzzzz

Yes, but if you're writing software which is supposed to work
reliably, that's really of little use. Although it allow you to toy
with and learn new features early.

/Jorgen

Well this is short introspection of new features from gcc 4.8 ;)
It is pretty reliable, I think...

#include <iostream>
#include <mutex>
#include <thread>

class A{
public:
A(int i):i(i){}
alignas(double) int i;
};

class alignas(16) B:public A{
public:
B():B(42){}
using A::A;
};

void f(int i)
{
static thread_local B b(i);
static std::mutex m;
std::lock_guard<std::mutex> g(m);
std::cout<<b.i<<'\n';
}

int main()
{
std::thread a(f,1);
std::thread b(f,2);
a.join();
b.join();
}

bmaxa@maxa:~/examples$ g++-trunk -std=c++11 -pthread inherit.cpp -o inherit

bmaxa@maxa:~/examples$ ./inherit
1
2
 
J

Jorgen Grahn

I'm guessing it's the "from svn repository" bit that was being referred
to here.

Yes, that's what I meant. I can't remember the last time I compiled
with anything /but/ gcc! But it's typically a gcc version which is
a few years old: 3.4, 4.1, 4.4 ...

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top