Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,868 questions

51,791 answers

573 users

How to tell the compiler to not use the default constructor in C++

1 Answer

0 votes
#include <iostream>

class Test
{
public:
    Test() = delete;
};

int main() {
  
    Test t; // Test::Test(void)': attempting to reference a deleted function
    
    std::cin.get();
}



/*
run:


*/

 



answered Feb 24, 2022 by avibootz
edited Feb 26, 2022 by avibootz

Related questions

1 answer 126 views
126 views asked May 11, 2018 by avibootz
1 answer 109 views
109 views asked Sep 15, 2022 by avibootz
1 answer 107 views
107 views asked Jul 16, 2022 by avibootz
1 answer 116 views
116 views asked Sep 8, 2020 by avibootz
1 answer 153 views
1 answer 64 views
1 answer 107 views
107 views asked Dec 4, 2022 by avibootz
...