From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH kvm-unit-tests 2/4] Introduce a C++ wrapper for the kvm APIs Date: Wed, 24 Nov 2010 19:41:34 +0200 Message-ID: <20101124174134.GK20014@redhat.com> References: <1290595933-13122-1-git-send-email-avi@redhat.com> <1290595933-13122-3-git-send-email-avi@redhat.com> <50DD1E97-0ECD-41E6-B6F8-1D78AA4A4876@suse.de> <4CED2416.1040102@codemonkey.ws> <20101124154006.GE15111@redhat.com> <4CED344B.3030000@codemonkey.ws> <20101124161204.GF15111@redhat.com> <4CED3FE5.4000801@codemonkey.ws> <20101124173345.GI20014@redhat.com> <4CED4DDB.707@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Anthony Liguori , Alexander Graf , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:61329 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754131Ab0KXRln (ORCPT ); Wed, 24 Nov 2010 12:41:43 -0500 Content-Disposition: inline In-Reply-To: <4CED4DDB.707@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 24, 2010 at 07:39:39PM +0200, Avi Kivity wrote: > On 11/24/2010 07:33 PM, Gleb Natapov wrote: > >> > >> But I don't see the point. If you look at my repository, there's > >The point is that C++ is ugly language. The short code Avi sent remind > >me perl (aka line noise). It is almost impossible to parse it into > >what code it actually does. Most symbols are there for C++ syntax not > >functionality. > > No. They're there for error handling. A C++ wrapper, doesn't add > any functionality, so you can say that all of the lines of codes do > nothing and are just syntax. But they do allow you to pair init and > uninit (in the constructor and destructor). When you use the > wrapper (as opposed to the bare C interface) you get the value by > not having to code long error handling sequences (with a high > probability of getting them wrong and never finding out in testing). > So how errors are handled there? By throwing exceptions? Sorry this is not error "handling". -- Gleb.