MESSAGE
DATE | 2016-11-08 |
FROM | Ruben Safir
|
SUBJECT | Re: [Learn] C++ signature ambiguity
|
From learn-bounces-at-nylxs.com Fri Nov 11 06:21:14 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 A3713161312; Fri, 11 Nov 2016 06:21:14 -0500 (EST) X-Original-To: learn-at-nylxs.com Delivered-To: learn-at-nylxs.com Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) by mrbrklyn.com (Postfix) with ESMTP id BA919160E77 for ; Fri, 11 Nov 2016 06:21:11 -0500 (EST) Received: by mail-qk0-f173.google.com with SMTP id n204so15365891qke.2 for ; Fri, 11 Nov 2016 03:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=my.liu.edu; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=zGHWOri83G4JQhgsANtcsvX8ukKAVx5YkCxCAH5g7xw=; b=Xhzuj3XqxDh/3Ik8l+sMQil6UtssfcW3FaeTLjTFdWnjRyrOR704T1P8TKVnbqAtYg 2nbi6GNpB8bRbmqkCKKYGW2EKsIu4pBpAYZkbEkGNIrI6eouItDq+yumvH57zM7r4tDf deqgis86Clm9icEl9c8cqlwo4kT7Wbl1UubW4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=zGHWOri83G4JQhgsANtcsvX8ukKAVx5YkCxCAH5g7xw=; b=UbM+9fstR8vgASRozijPClxgJQBZF6QVCN3/4EytR9pUHZzNsaJDCH3YF0kLaKUuIS jkmGPVPgctxKtlGj/444mpRnNcnvUQB0+4gOwZ8qk8cUYqlam8v5rHGjfQ2mr5tn/hhD JMiz6OLfpPpTCv7E01fpcKeZhZQgWAWLS2rSP+9Fx+LaZ0hku0Vaml/yPkvM4rbNRZqy Wz6dbC039L+jLK/YGE6gnSv9Wr1l8/KI8Rq/JHuxMKylIVPGjcN/ObPR5prhjc1ZAPyQ mFK3AzawxQ04oWGnOQ1JPVMBbQ5psg6NeophlAT4UIDi9vrKoI5IuBbkB6OXAlL2oj2W aV/g== X-Gm-Message-State: ABUngvd1v+3kkBFpdyBzSWvACfGXTuSySgfz+g0FhVJlFjSOmJu8wYyT55T23vp6GDnt1dQr X-Received: by 10.55.138.129 with SMTP id m123mr15934293qkd.159.1478638474000; Tue, 08 Nov 2016 12:54:34 -0800 (PST) Received: from [10.0.0.62] (www.mrbrklyn.com. [96.57.23.82]) by smtp.googlemail.com with ESMTPSA id 6sm20366490qke.18.2016.11.08.12.54.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 12:54:33 -0800 (PST) To: learn-at-nylxs.com References: <87r36logj1.fsf-at-contrapunctus.net> From: Ruben Safir Message-ID: Date: Tue, 8 Nov 2016 15:54:33 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87r36logj1.fsf-at-contrapunctus.net> Subject: Re: [Learn] C++ signature ambiguity 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="windows-1252" Content-Transfer-Encoding: quoted-printable Errors-To: learn-bounces-at-nylxs.com Sender: "Learn"
On 11/08/2016 03:36 PM, Christopher League wrote: > Unclear to me why one might need both, but I tried removing the > reference version and it died with a similar error somewhere else. Maybe > I just needed to push the change further, into member classes. > =
> I think it=92s perfectly fine to decide either that every generic type > parameter is a pointer (what Java does), or that it=92s passed by value= =85 > and then the client code can specify it either as |foo| if it expects > copies, or |foo| if it expects dynamic allocation. The duplication > of supporting every variation of |T|, |T&|, |const T&|, and |const T& > const| (is that a thing?) is damn annoying. > =
> CL > =
I'm on the horn with google engineers about it right now.
Look at the current code and explain this error? I need to understand why = this fails.
|| g++ -Wall -ggdb -c nodes.cpp || g++ -Wall -ggdb -o fitch.o -c fitch.cpp =
|| nodes.h: In instantiation of =91tree::NODE::NODE(std::__cxx11::stri= ng, const unk&, tree::NODE*, tree::NODE*, tree::NODE*) [with= unk =3D tree::Pstates; std::__cxx11::string =3D std::__cxx11::basic_s= tring]=92: fitch.cpp|22 col 55| required from here nodes.h|105 col 96| error: no matching function for call to =91tree::Pstate= s::Pstates()=92 || NODE::NODE( std::string xt, const unk &x, NODE *xcl , NODEk> *xcr, NODE *xp ){ || = ^ nodes.h|180 col 3| note: candidate: tree::Pstates::Pstates(std::vecto= r >) [with cost =3D int] || Pstates (std::vector< state > x) || ^~~~~~~ nodes.h|180 col 3| note: candidate expects 1 argument, 0 provided nodes.h|174 col 7| note: candidate: tree::Pstates::Pstates(const tree:= :Pstates&) || class Pstates || ^~~~~~~
> Ruben Safir ruben-at-mrbrklyn.com writes: > =
> I need to separate these two method signatures > =
> =
> include > =
> =
> include > =
> =
> include =93nodes.h=94 > =
> using namespace std; > =
> int main(int argv, char ** argc) { tree::state a{=93A=94, 65500}; > tree::state c{=93C=94, 0}; tree::state g{=93G=94, 65500}; tree::state= t{=93T=94, > 65500}; > =
> vector< tree::state > posible_states =3D {a,c,g,t}; > =
> tree::Pstates node_status{posible_states}; tree::NODE cr1{=93T01=94, = 3}; > tree::NODE cl1{=93T00=94,2}; // tree::NODE root{=93T0=94,1}; > =
> // tree::NODE > cr1{=93T01=94, 3}; // tree::NODE > cl1{=93T00=94,2}; > tree::NODE > root{=93T0=94,node_status}; return 0; } > =
> template class NODE{ public: > //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3DLIFECYCLE=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > /* Constructor // NODE( std::string xt, unk &x , NODE /xcl=3D 0, NODE > /xcr =3D 0, NODE /xp =3D 0 ); NODE( std::string xt, unk x , NODE /xcl= =3D > 0, NODE /xcr =3D 0, NODE *xp =3D 0 ); ~NODE(); > =
> I=92m open to ideas > =
> http://www.nylxs.com/docs/thesis/src/fitch/fitch.tgz is the code > =
> =96 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 > =
> =
> =
> _______________________________________________ > Learn mailing list > Learn-at-nylxs.com > http://lists.mrbrklyn.com/mailman/listinfo/learn > =
-- =
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
|
|