Skip to main content
grammar corrected
Source Link
danday74
  • 58.1k
  • 56
  • 273
  • 337

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone diddo this and it ran on both Windows and Linux.

It just doesn't do what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone did this and it ran on both Windows and Linux.

It just doesn't do what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone do this and it ran on both Windows and Linux.

It just doesn't do what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone dodid this and it ran on both Windows and Linux.

It just doesn't todo what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone do this and it ran on Windows and Linux.

It just doesn't to what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone did this and it ran on both Windows and Linux.

It just doesn't do what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

Updated to working link; the old is no longer online.
Source Link
Tommy
  • 100.7k
  • 12
  • 187
  • 205

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone do this and it ran on Windows and Linux.

It just doesn't to what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.3https://isocpp.org/wiki/faq/ctors#init-methods

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone do this and it ran on Windows and Linux.

It just doesn't to what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.3

I believe you can call a constructor from a constructor. It will compile and run. I recently saw someone do this and it ran on Windows and Linux.

It just doesn't to what you want. The inner constructor will construct a temporary local object which gets deleted once the outer constructor returns. They would have to be different constructors as well or you would create a recursive call.

Ref: https://isocpp.org/wiki/faq/ctors#init-methods

Copy edited. Expansion.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
Source Link
sqqqrly
  • 893
  • 1
  • 7
  • 10
Loading