Top "New-operator" questions

new is a language construct that dynamically allocates memory from free store and initialises the memory using the constructor.

Hibernate new keyword with distinct

I need to take hql that is currently : select distinct a from Asset as a where ... and change it to …

hibernate hql new-operator distinct
C++ - Allocating memory on heap using "new"

If I have the following statement: int *x = new int; In this case, I have allocated memory on the heap …

c++ heap new-operator dynamic-memory-allocation memory-address
JavaScript difference between function and new function

The following JavaScript code is very confusing to me. Could anyone help me understand. Why does PersonY not have prototype …

javascript new-operator
Placement new and non-default constructors

Can I call the C++ placement new on constructors with parameters? I am implementing a custom allocator and want to …

c++ new-operator placement-new
Is Java slow when creating Objects?

In my current project (OpenGL Voxel Engine) I have a serious issue when generating models. I have a very object …

java performance oop new-operator object-construction
Modifying a namedtuple's constructor arguments via subclassing?

I want to create a namedtuple which represents the individual flags in a short bitfield. I'm trying to subclass it …

python new-operator super namedtuple
What is the difference between type and type.__new__ in python?

I was writing a metaclass and accidentally did it like this: class MetaCls(type): def __new__(cls, name, bases, dict): …

python types new-operator metaclass
How does the new operator work in JavaScript?

Probably the least understood part of JavaScript, standing beside the prototype chain. So the question is: how does... new dataObj(…

javascript oop object new-operator
operator new overloading and alignment

I'm overloading operator new, but I recently hit a problem with alignment. Basically, I have a class IBase which provides …

c++ operator-overloading new-operator