glm::io additional operators and properties #1232
                
     Open
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Hello!
I was using
glm::ioand found myself wanting to print matrices in a single line easily.I saw very convinient operators for easily changing
precision,width... but none forspaceandnewline, hence this PR commits:spaceandnewlinewith a packed struct namedfiller(related tostd::setfill), following the same structure as the structdelimeter.delimeteroptional last argument. Seems pretty useful to have them in order to restore the default behavior.precision=3andwidth=8likeformat_punctdoes in the default constructor (actually done in a later commit).Skip initial newline when printing matrices. IMO seems more logical to let the end user do it, in my case I need this to be able to print matrices in a single line.Introduces differences with previous outputs! Quite noticeable, but consistent with vector behavior.width=0and keep an space between components for better visualization.fillproperty instead of doingsetw(space). This allows to set e.g.'0'as filler only, becausespacewas also being used in many other places. Can be modified as part of the structfiller.firstlineproperty to be able to keep the previous behavior broken in commit (3.), basically replaces the firstnewlinefor a customizable character. Can be modified as part of the structfiller.io::formatted:io::resetto restore default settings andio::compressedto setup single line printing.I split the commits for simpler discussion/review/changes, let me know what you think.
I can squash them all in the end or whatever you prefer.
Regards!