Thinking about this a bit more still, I think we can do this in two
ways to make everything work properly.  We can check for the
__cpp_lib_string_view macro and/or _MSVC_LANG(because windows always
needs to be different), and if the compiler supports std::string view
we use that at compile-time to pass in the const char* to the
LocationInfo class.  If we can't do it at compile time, we will figure
it out at runtime inside of the LocationInfo.  Either way this adds
one const char* to the LocationInfo class.

Regardless, the full path to the file is still embedded in the
binaries of users of the library unless you explicitly turn that off.
I'll add some documentation related to that.

-Robert Middleton


On Sun, Jan 2, 2022 at 8:07 AM Thorsten Schöning <tschoen...@am-soft.de> wrote:
>
> Guten Tag Robert Middleton,
> am Sonntag, 2. Januar 2022 um 02:38 schrieben Sie:
>
> > 2. Create a constexpr function that we control[...]
> > 3. Use std::string_view(for C++17) or
> > boost::string_view(pre-c++17).[...]
>
> Just to make sure I understand correctly: The difference between 2 and
> 3 is using a custom implementation vs. an already available one?
>
> As we rely on boost for whatever is not supported by the compiler
> anyway already, I prefer yur option 3 then. Looking at the PR, we had
> already three different implementations proposed in the end and I
> don't see any benefit to discuss those further when "string_view"
> handles all of this already.
>
> > [...]I can see certain
> > circumstances where it is useful to have the full path, for example
> > when you have two files named the same(please don't do this).
>
> I'm doing this sometimes and in theory it shouldn't be a problem if
> placed into different namespaces. Shouldn't it? Of course some broken
> IDEs/compilers like Embarcadero C++-Builder don't work properly with
> that in case of incremental builds, but that's not too much of a
> problem for me.
>
> Regarding absolute paths, one might want to keep in mind that not
> everyone ships results from automatic builds like Jenkins only and/or
> uses multiple different branches for different customers with slightly
> modified codebase at the same time. So keeping absolute paths if
> available before makes sense to me.
>
> Mit freundlichen Grüßen
>
> Thorsten Schöning
>
> --
> AM-SoFT IT-Service - Bitstore Hameln GmbH
> Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und TK
>
> E-Mail: thorsten.schoen...@am-soft.de
> Web:    http://www.AM-SoFT.de/
>
> Tel:   05151-  9468- 0
> Tel:   05151-  9468-55
> Fax:   05151-  9468-88
> Mobil:  0178-8 9468-04
>
> AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska
>
>
>
>

Reply via email to