ax_cxx_delete_method

Synopsis

AX_CXX_DELETE_METHOD

Description

Check whether the C++11 ’= delete’ syntax, for suppressing undesired implicit methods, is supported. If it is, the macro DELETE_METHOD is defined to ’= delete’; otherwise it is defined to nothing. Thus, you can write

  class foo {
    ...
  private:
    foo(foo const&) DELETE_METHOD;
  };

to delete the ’foo’ copy constructor or fall back to the idiom of a private undefined method if the compiler doesn’t support this.

Does not test ’= delete’ on a template specialization. Does not ensure that the compiler is in C++11 mode.

Source Code

Download the latest version of ax_cxx_delete_method.m4 or browse the macro’s revision history.

License

Copyright © 2012 Zack Weinberg 

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.