Question

I'm currently writing some c++ code for the AVR platform and I'm wanting to disable something that's fundamentally non-copyable. Given that I'm already using c++0x features I thought that a good way to do this would be to use the =delete specifier:

write_only(write_only const&) = delete;

However when I try to compile this I get the following error:

error: invalid pure specifier (only `= 0' is allowed) before ';' token

This suggests to me that this particular c++0x language feature is not supported by avr-gcc. Is this something I'm doing wrong? If not, what is the best workaround for this?

I'm using WinAVR-20100110 to compile.

Was it helpful?

Solution

WinAVR is outdated, use Atmel Studio instead.

If you really want to continue with WinAVR, find gcc or g++ executable and run it with -v command line argument, then tell us what version it reports. Note, that Deleted functions supported in GCC since version 4.4 (link).

Anyway, you also must add -std=gnu++0x or -std=c++11 or -std=gnu++11 parameters when compiling to use C++11 features, or -std=c++1y or -std=gnu++1y to enable C++14 (C++1y) features.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top