MESSAGE
DATE | 2016-11-20 |
FROM | Ruben Safir
|
SUBJECT | Subject: [Learn] when is the constructor called for an object
|
From learn-bounces-at-nylxs.com Sun Nov 20 21:25:07 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id D651E161314; Sun, 20 Nov 2016 21:25:06 -0500 (EST) X-Original-To: learn-at-nylxs.com Delivered-To: learn-at-nylxs.com Received: from [10.0.0.62] (flatbush.mrbrklyn.com [10.0.0.62]) by mrbrklyn.com (Postfix) with ESMTP id B8843161312 for ; Sun, 20 Nov 2016 21:25:03 -0500 (EST) To: learn-at-nylxs.com From: Ruben Safir Message-ID: Date: Sun, 20 Nov 2016 21:25:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Subject: [Learn] when is the constructor called for an object X-BeenThere: learn-at-nylxs.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: learn-bounces-at-nylxs.com Sender: "Learn"
[This mail was also posted to alt.comp.lang.learn.c-c++.]
I have a class class{ public: Node(Node *){}; Node(){}; Node* left() { return _left; } left(Node *in) { _left=in; }
private: Node * _left; Node * _right;
and in another class I call
Node * tmp;
and later I want to allocate its memory (without using new)
I use tmp = nullptr;
I can't seem to use tmp{nullptr};
and when I try tmp(nullptr){};
if says tmp is not a function
when is the constructor called?
-- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com
Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013 _______________________________________________ Learn mailing list Learn-at-nylxs.com http://lists.mrbrklyn.com/mailman/listinfo/learn
|
|