MolecularMatters / raw_pdb

A C++11 library for reading Microsoft Program DataBase PDB files
BSD 2-Clause "Simplified" License
675 stars 91 forks source link

I am not sure I understand the validity of PDB_NO_ALIAS #69

Closed Scr3amer closed 1 year ago

Scr3amer commented 1 year ago

Hello !

I was trying to compile your project with llvm + MinGW, which requires some change in your code.

(I made it work so expect a PR soon :) )

I found the PDB_NO_ALIAS macro but I am not sure I understand why it is correct in your use case because the pointer returned by ArrayView::Decay is the same as the one provided to its constructor so it is an alias ?

Or did I misunderstand the very definition of aliasing ?

Cheers, Scr3am

MolecularMatters commented 1 year ago

I think you might be right about this. It is probably best to get rid of PDB_NO_ALIAS completely, since it won't affect code generation much anyway.

In cases where aliasing really could be a problem, using local variables on the stack is a much better solution.

MolecularMatters commented 1 year ago

I removed PDB_NO_ALIAS in 3c224f6.