You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Walt Karas <wk...@verizonmedia.com.INVALID> on 2019/09/26 16:35:07 UTC

Fwd: [apache/trafficserver] ProxySession cleanup: moving inline functions to .h (#5908)

An issue with using C++20 modules would be cherry-picking into older ATS
releases.  We could use a cheesy-but-usable macro processor I originally
wrote back in the 80s to allow module declaration files to also be used as
old-fashioned header files:
---
$(module_once) // expands to nothing in C++20
$(export_module parent1 parent2 name) // expands to nothing in C++17 or
older, arbitrary number of parents, or none
$(export) void foo();
$(module parent1 parent2 name)
$(import parent1 parent2 name)
---
$(name arg1 arg2 ....) is a macro call.  In C++20 these would expand to:
---
export module parent1_parent2_name;
export void foo();
module parent1_parent2_name;
import parent1_parent2_name;
---
In C++17 or older these would expand to:
---
#pragma once
void foo();
#include <parent1/parent2/name.h>
#include <parent1/parent2/name.h>
---

---------- Forwarded message ---------
From: Masakazu Kitajo <no...@github.com>
Date: Thu, Sep 26, 2019 at 3:49 AM
Subject: Re: [apache/trafficserver] ProxySession cleanup: moving inline
functions to .h (#5908)
To: apache/trafficserver <tr...@noreply.github.com>
Cc: Walt Karas <wk...@verizonmedia.com>, Mention <
mention@noreply.github.com>


Just for a note and I'm not sure at all, but Module that will be supported
on C++20 might resolve some of this complication.
https://www.infoq.com/news/2019/07/cpp20-draft-finalized/

Module support will be orthogonal to namespaces and will enable the
structuring of large codebases into logical parts without requiring the
separation of header and source files.