Boost logo

Boost :

Subject: Re: [boost] Environment Variables Library?
From: Michael Ainsworth (michael_at_[hidden])
Date: 2015-05-21 21:09:03


> I would recommend against this particular style. Variables like PATH might be accessed either as a complete string (in which case += should do a normal string append without any separator, and the iterator would be the string's character iterator) or as individual components; it should be obvious which of these is being done.

It sounds like you're assuming the iterator to point to a string. The iterator could actually point to a 'variable' type which has knowledge of the path separator built in.

> If the goal is to have a cross-platform library, then I think that one of the following should be chosen:
>
> 1. A standalone library that only provides strings and makes no attempt to separate PATH into components.
>
> 2. A library that depends on Filesystem and provides both full-string access as well as a cross-platform way to split PATH (and other arbitrary variables) into Filesystem path components.
>
> I don't think a half-measure (splitting paths but not using Filesystem) is desirable because it compromises the goal of being a portable library, since the path separators are different


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk