220 2373 <CAN6o=f-M6XHaYST6NYUtiiwuOh8RcfBWyWAs6gL=vWzbEm=EcQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Aleksandar Fabijanic <aleks.fabijanic@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional<T>, one more value or two states
Date: Sun, 27 Jan 2013 16:47:29 -0600
Lines: 43
Approved: news@gmane.org
Message-ID: <CAN6o=f-M6XHaYST6NYUtiiwuOh8RcfBWyWAs6gL=vWzbEm=EcQ@mail.gmail.com>
References: <CAGsORuC1ADLXgS9AZZiTo=knmhT-+9Yj+82v+b8Nq_WJpb1fOg@mail.gmail.com>
	<CAFk2RUZyZA0LLUNuVNcnibv+qBF69jMytWQL3tkp-Kp21oEU+A@mail.gmail.com>
	<CAGsORuB-Qkx-LaXj2jO4yLrwN524kiJONSg7oczkQZHYaJ6ASg@mail.gmail.com>
	<d360a952-28ae-4d57-bb20-96fd08725a0b@isocpp.org>
	<CAPXezF_JggyMaXjGS9r1EAGVu1NhQBEyGEXB8tKmVqgFfjoCeg@mail.gmail.com>
	<CALJmx62zJd_tZ=XYL7TaSkRN6432SObwH9YS87eLX-h_pMuFYQ@mail.gmail.com>
	<CAOHCbivAK0ypmMhrhJ3zKpF8BHu3h_rUNzeao-HnibJkC-qqGw@mail.gmail.com>
	<ef15483d-5665-4da3-9b79-aefd3c725e1b@isocpp.org>
	<CAOHCbithEUfm+w_06V71=hpkqGUJvqiyDFqD7fesfgLy4uUieg@mail.gmail.com>
	<2c2b9360-8e5e-422d-9b85-124bd947b004@isocpp.org>
	<CAOHCbivJzdQbe22URgRuahCYYDPG8Ygsc4VG7f61zRBWXogekg@mail.gmail.com>
	<CAOHCbivMvix0WgGJqc2tKTC+y8vv0Coeb-msCJ4C=tMi1OMbhg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1359326854 4445 80.91.229.3 (27 Jan 2013 22:47:34 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 27 Jan 2013 22:47:34 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDFNLOXOTALRBAW5S2EAKGQESHO6PYI@isocpp.org Sun Jan 27 23:47:54 2013
Return-path: <std-proposals+bncBDFNLOXOTALRBAW5S2EAKGQESHO6PYI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f198.google.com ([209.85.214.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDFNLOXOTALRBAW5S2EAKGQESHO6PYI@isocpp.org>)
	id 1Tzb0v-0006um-H2
	for gclcip-std-proposals@m.gmane.org; Sun, 27 Jan 2013 23:47:49 +0100
Original-Received: by mail-ob0-f198.google.com with SMTP id dn14sf12921572obc.9
        for <gclcip-std-proposals@m.gmane.org>; Sun, 27 Jan 2013 14:47:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :mime-version:x-received:in-reply-to:references:date:message-id
         :subject:from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=93ZpqG4XTtgZioPO03Tvyqv6NgALtiD/aA9/yBLyN+s=;
        b=mRItMHVCSzYtwwNMC0BzHs0By6JQ8SmCPMgaSntp3rB/GWuXrn2aY89XGIsh6LgQI/
         4kjVvrTjVvqD2TkUcRdAsac2Z3yxldf1/HOfo7WALuV3cGjNBw0mcnEzem0Yx2UULm5l
         A6z0uIMEOxZEBUTyqBZnDZMTNW5JWY/ZT7f3Rq+kZcjKl3uVL0/1rFC7HCqyMbFdZfi3
         PwB2lyxoFW11b6plzZMiyHRSY43597vpB19P0uB5X5t+d0xsiL5Cqdv50fl0kxM6k0GE
         pcZXnMbL46HXz1nrjE17Vp7BQ6hxbu8evKnaZim8l7mVWigDq 
X-Received: by 10.182.217.104 with SMTP id ox8mr1866635obc.28.1359326850731;
        Sun, 27 Jan 2013 14:47:30 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.124.106 with SMTP id mh10ls182925obb.22.gmail; Sun, 27 Jan
 2013 14:47:30 -0800 (PST)
X-Received: by 10.182.118.105 with SMTP id kl9mr734775obb.52.1359326850173;
        Sun, 27 Jan 2013 14:47:30 -0800 (PST)
X-Received: by 10.182.118.105 with SMTP id kl9mr734774obb.52.1359326850159;
        Sun, 27 Jan 2013 14:47:30 -0800 (PST)
Original-Received: from mail-oa0-f45.google.com (mail-oa0-f45.google.com [209.85.219.45])
        by mx.google.com with ESMTPS id qk8si7377784obc.17.2013.01.27.14.47.30
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 27 Jan 2013 14:47:30 -0800 (PST)
Received-SPF: pass (google.com: domain of aleks.fabijanic@gmail.com designates 209.85.219.45 as permitted sender) client-ip=209.85.219.45;
Original-Received: by mail-oa0-f45.google.com with SMTP id o6so167342oag.32
        for <std-proposals@isocpp.org>; Sun, 27 Jan 2013 14:47:30 -0800 (PST)
X-Received: by 10.60.11.67 with SMTP id o3mr9534106oeb.24.1359326850026; Sun,
 27 Jan 2013 14:47:30 -0800 (PST)
Original-Received: by 10.76.3.205 with HTTP; Sun, 27 Jan 2013 14:47:29 -0800 (PST)
In-Reply-To: <CAOHCbivMvix0WgGJqc2tKTC+y8vv0Coeb-msCJ4C=tMi1OMbhg@mail.gmail.com>
X-Original-Sender: aleks.fabijanic@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of aleks.fabijanic@gmail.com designates 209.85.219.45 as permitted
 sender) smtp.mail=aleks.fabijanic@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:2373
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2373>

On Fri, Jan 25, 2013 at 4:17 PM, Tony V E <tvaneerd@gmail.com> wrote:
>>
>> Is there a difference between empty and null?
>>
> Is there a difference between empty and null?

There is difference, here are some real world examples:

1) see https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Optional.h#L70
:

/// Note that the Optional class is basically the same as
/// Nullable. However, serializers may treat Nullable
/// and Optional differently. An example is XML serialization based
/// on XML Schema, where Optional would be used for an element with
/// minOccurs == 0, whereas Nullable would be used on an element with
/// nillable == true.

2) Another example is how different databases treat empty string,
see https://github.com/pocoproject/poco/blob/develop/Data/include/Poco/Data/AbstractSessionImpl.h#L99
:

/// Adds "emptyStringIsNull" feature and sets it to false. This
feature should be
/// set to true in order to modify the behavior of the databases that
distinguish
/// between zero-length character strings as nulls. Setting this
feature to true
/// shall disregard any difference between empty character strings and nulls,
/// causing the framework to treat them the same (i.e. behave like Oracle).

Alex

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To post to this group, send email to std-proposals@isocpp.org.
To unsubscribe from this group, send email to std-proposals+unsubscribe@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



.
