fork download
  1.  
  2. #include <functional>
  3. #include <new>
  4.  
  5. int main() {
  6. typedef void*(*newptr_type)(std::size_t);
  7. typedef void(*delptr_type)(void*);
  8. auto al = std::bind<void*>(newptr_type(::operator new), sizeof(char)*100);
  9. auto dl = delptr_type(::operator delete);
  10.  
  11. auto field = (char*)al();
  12. dl(field);
  13. }
  14.  
  15. void othermain() {
  16. auto al = [](){return new char[100];};
  17. auto dl = [](char* p){delete[] p;};
  18.  
  19. auto field = (char*)al();
  20. dl(field);
  21. }
Success #stdin #stdout 0s 3024KB
stdin
Standard input is empty
stdout
Standard output is empty