See the code:
#include <iostream>
#include <functional>
struct Copy
{
Copy(){}
Copy(const Copy&)
{
std::cout << "Copied!\n";
}
Copy(Copy&&)
{
std::cout << "Mov…
Created on 1/23/2013 (updated 10 weeks ago) | 0 validations | 0 workarounds | 3 comments | feedback id: 777256
|
|
|
Closed
as Deferred
|
|
The following code gives the error C3522:
template<class... T> struct value_holder {
template<T... Values> struct apply { };
};
int main()
{
}
Full error description: error C3522: 'T' : para…
Created on 1/9/2013 (updated 16 weeks ago) | 0 validations | 0 workarounds | 5 comments | feedback id: 776111
|
|
|
Closed
as Fixed
|
|
The following code gives error C2753 while it should not generate any errors:
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <string>
using namespace std;
template <bool... Bits>
str…
Created on 1/8/2013 (updated 10 weeks ago) | 0 validations | 0 workarounds | 4 comments | feedback id: 776024
|
|
See the code below:
#include <initializer_list>
class A
{
public:
A(std::initializer_list<int> list)
{
}
A(std::initializer_list<double> list)
{
}
};
int main()
{
A a{};
…
Created on 11/14/2012 (updated 16 weeks ago) | 0 validations | 0 workarounds | 7 comments | feedback id: 771018
|
|
|
Closed
as Fixed
|
|
See the code below:
class A
{
public:
A(const std::initializer_list<int>& list)
{
}
};
int main()
{
A a = {1,2,3};
};
Code should compile but in fact it doesn't. It compiles only wit…
Created on 11/13/2012 (updated 20 weeks ago) | 0 validations | 0 workarounds | 3 comments | feedback id: 770888
|
|
|
Closed
as Fixed
|
|
Here is the code:
#include <atomic>
int main()
{
std::atomic_int integer(0);//#1
std::atomic<int> otherInteger(0);//#2
}
While #2 compiles successfully the #1 doesn't. It is due to…
Created on 8/28/2012 (updated 15 weeks ago) | 0 validations | 0 workarounds | 3 comments | feedback id: 759934
|
|
Create basic project and add cout to it:
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << std::string("dkfdsf");
return 0;
}
and it won't compile…
Created on 6/1/2012 (updated 49 weeks ago) | 0 validations | 0 workarounds | 3 comments | feedback id: 745602
|
|
|
Closed
as External
|
|
Try the following code:
class A
{
public:
void foo(int&& i)
{
}
};
int main()
{
A a;
auto b = std::bind(&A::foo, a, std::placeholders::_1);
b(5);
}
it gives the follow…
Created on 4/20/2012 (updated 15 weeks ago) | 1 validation | 0 workarounds | 4 comments | feedback id: 737872
|
|
Given the following code:
#include <thread>
#include <mutex>
#include <condition_variable>
std::condition_variable g_Condition;
std::mutex g_Mutex;
int main()
{
auto call = []()
…
Created on 4/3/2012 (updated 54 weeks ago) | 1 validation | 0 workarounds | 5 comments | feedback id: 735224
|
|
|
Closed
as Fixed
|
|
I have the following code:
template <class T>
class A
{
public:
template <class U>
static U foo(T* p)
{
p;
return U();
}
};
class B
{
template <class T>
temp…
Created on 3/19/2012 (updated 11 weeks ago) | 0 validations | 0 workarounds | 3 comments | feedback id: 731937
|
|
|
Closed
as Deferred
|
|