Skip to content

Instantly share code, notes, and snippets.

@kikairoya
Created November 23, 2011 23:16
Show Gist options
  • Save kikairoya/1390214 to your computer and use it in GitHub Desktop.
Save kikairoya/1390214 to your computer and use it in GitHub Desktop.
#include <vector>
class myclass{
public:
myclass(const std::vector<int>&){
throw std::exception();
}
private:
myclass() = delete;
};
int main() {
std::vector<int> a;
myclass(a);
// error: conflicting declaration 'myclass a'
// error: 'a' has a previous declaration as 'std::vector<int> a'
myclss{a}; // OK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment