220 38459 <3eaf8f38-0284-424b-9dc8-10db869fdb69@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Omer Rosler <omer.rosler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Concepts fragmentation problem
Date: Sun, 3 Jun 2018 09:48:08 -0700 (PDT)
Lines: 55
Approved: news@gmane.org
Message-ID: <3eaf8f38-0284-424b-9dc8-10db869fdb69@isocpp.org>
References: <f686b7c7-83c4-4779-9f91-316bbe3bab4b@isocpp.org>
 <CAC+0CCMee4=AGpF3=9mazT1UwxFqobdJ-kpHyE+82O2UmmQtDQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_23003_970630986.1528044488303"
X-Trace: blaine.gmane.org 1528044364 17324 195.159.176.226 (3 Jun 2018 16:46:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 3 Jun 2018 16:46:04 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC2L3NWCRYJBBSNX2DMAKGQE2V4GQUI@isocpp.org Sun Jun 03 18:46:00 2018
Return-path: <std-proposals+bncBC2L3NWCRYJBBSNX2DMAKGQE2V4GQUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC2L3NWCRYJBBSNX2DMAKGQE2V4GQUI@isocpp.org>)
	id 1fPW8l-0004O0-BE
	for gclcip-std-proposals@m.gmane.org; Sun, 03 Jun 2018 18:45:59 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id n201-v6sf10292715ywd.17
        for <gclcip-std-proposals@m.gmane.org>; Sun, 03 Jun 2018 09:48:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=RUM7rIAbTGSGnOCwYdVugfk0iip8zKdfhdH6MH7eEGI=;
        b=H33b+kjr2EwQvrZsSZE1o57jf+lbza62nVY9BPbcybhHt/4F8a1uIOQjBEo1QTr6p2
         p+mzKIBvWW81HXagHEaEYYGQ2xEa63OeKkprK29SzedcNEj3w4LPN+kgvm2glBwm3HpD
         8dJyatBrx6rr4MbOfeDqPJa0n51Yithr7jTAuLemzZV44BMm0yT3r/ABsBX/iANgDALw
         AUIhtPvFqAXpK0xhf6Xtij6UGb/lGBRF/TXdUKg5yqtp95Cpau5DD9tj+eIG//pK9DgQ
         1RD0MHXG5PmymT/97Q5H0Pf/zaXqK555PUFoDJbaGuN/5OkIG/Yag4BqhvDghjS8RSYN
         dAsg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=RUM7rIAbTGSGnOCwYdVugfk0iip8zKdfhdH6MH7eEGI=;
        b=JPLs9kW9451vOBwRFkqOCePEA5EkQdSGIkMkP5LZBKPMlyIw0EvtVR3L9ANatiEjA+
         aT5CMHyhGMmFTc7s4wGeMDLeNeahQeUmis37DlsUwDutPTbuKCXb3NhY9EE5RA63/qx8
         nxGTmZrPnfl8QmzAGC5K0aSbXjkl/F8A8BUyANQmvTB0jCX9H47b5TeJD7LCuTGGuXPg
         2+TExu3tDnF/V6otBgUPWVLY1BQHq7igUzk7kfpgeN7uNP0J+IncIM/lnDX+TZZLzAcH
         5GxEif9pomplVNB7B+K9nSJSj8pHkfoitvXVvq854GReZFjqYtNIWkfgnVPXOM5sTEv1
         N0GA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=RUM7rIAbTGSGnOCwYdVugfk0iip8zKdfhdH6MH7eEGI=;
        b=bIwXlfXZgOb96cUTdRh1JHshPWi0ryIFAMVosWj48uqKxP8xIs7qtE0QOH8AFMTH/t
         HTlDYAaixPqc1bFrH816DU3VWBDjenftkvMScEQqFsh/LCu87FXJHNiCpyHRQpcsz5DM
         gGeVkifQL4UUdvuhC9LuZUbdfFzpA8d4OzSf2JFxzOfjC/4gPuQvRwayzqLG0cmIwJrT
         JD+UK46IQpioIB/aib2ci2IZB4ooOgNutVsx1fmcyFBLWkFKJXGzR/eKWB5CFfsrBzcC
         SWx0faKsG2ZiE1aUG9ddC5cW3C2/1BAmr0O0h+9LGrCRk52nkYOjic4TyTrcZ3kftrGO
         7NZA==
X-Gm-Message-State: ALKqPwdax/pyrcBpvVNfEOxZhbzyLEYMWfeiZ1XQNLCgDZGAq5wIfeLX
	jfFpOy0I4wbThRDrFfhzuOWpDw==
X-Google-Smtp-Source: ADUXVKJ17AVhMNLe07EAlj7AXBjYYakEEfyN1HmF15FkZ8/mmkc/+HG766BbbNK6c0U1ml59HaTClg==
X-Received: by 2002:a81:5ac2:: with SMTP id o185-v6mr5675532ywb.35.1528044490172;
        Sun, 03 Jun 2018 09:48:10 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:a881:: with SMTP id f123-v6ls4949859ywh.2.gmail; Sun, 03
 Jun 2018 09:48:09 -0700 (PDT)
X-Received: by 2002:a81:9a4f:: with SMTP id r76-v6mr757199ywg.0.1528044488819;
        Sun, 03 Jun 2018 09:48:08 -0700 (PDT)
In-Reply-To: <CAC+0CCMee4=AGpF3=9mazT1UwxFqobdJ-kpHyE+82O2UmmQtDQ@mail.gmail.com>
X-Original-Sender: omer.rosler@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:38459
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38459>

------=_Part_23003_970630986.1528044488303
Content-Type: text/plain; charset="UTF-8"

On Sunday, June 3, 2018 at 4:21:19 AM UTC+3, Jake Arkinstall wrote:
> On Sun, 3 Jun 2018, 00:57 Omer Rosler <omer....@gmail.com> wrote:
> 
> This is a question/issue I have stumbled upon while trying out the concepts TS, I hope this is the right forum.
> 
> 
> 
> This kind of thing is well suited here. Although this is generally for bringing an idea to a proposal worthy state, critiques of current proposals and problems with accepted proposals are common and welcome.
> 
> 
> "Here is the problem: The concept users need to implement (if they use the adaptor) is not properly defined."
> 
> 
> Can you elaborate on this problem you describe with a further code sample? Something a little more concrete to work with - I got a little lost trying to understand your conclusion.

Think of a node library that abstracts away both memory access and connections between the nodes:

`template<typename T> concept DAGNode = requires {
    typename T::children_router_type;
    T T::get_child(children_router_type child_connection);
};
`
Now for a much more specific concepts - that of a binary tree node:
`
enum binary_node_connections
{
    left,
    right
};
template<DAGNode T> concept BinaryTreeNode = requires
{
    requires std::is_same_v<typename T::children_router_type, binary_node_connections>;

    T get_right();
    T get_left();
};
`

The interface that is exposed by the concept is supposed to be getting nodes by the specific functions - get_right and get_left
The default implementation of `get_child` using those methods can be given by a CRTP base, but then for node classes implementors this is a whole new concept to implement.
This is the underlying problem, especially if every concept does that.
For example we might add traversal requirement for any `DAGNode` or add a `BinarySearchTreeNode` for balanced trees that adds a search member function, etc etc.
This doubles the number of concepts. And completely separates users from implementers.

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3eaf8f38-0284-424b-9dc8-10db869fdb69%40isocpp.org.

------=_Part_23003_970630986.1528044488303--

.
