[ 
https://issues.apache.org/jira/browse/MINIFICPP-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16858355#comment-16858355
 ] 

Arpad Boda edited comment on MINIFICPP-910 at 6/7/19 7:13 AM:
--------------------------------------------------------------

Let me write the history of this as I think that's going to explain how this PR 
became this big.

I just saw multiple PRs recently where people had to do this manually, so I 
decided to extend StringUtils with a function that works mostly like join in 
Python.

I just wanted to add the template functions to allow concatenation of strings 
and numbers from different types of container. This shouldn't change anything, 
just add a couple of functions. Although I found that StringUtils is not a 
namespace, but a class. That's problematic as all the template functions added 
there become members, which prevents using SFINAE. 

Because of this I changed it to be a namespace, but that lead to either inline 
the functions or move them to a separate source file to avoid linking issues.

When I moved those out I got a bunch of linter errors, which only seem to 
appear for cpp files (I'm not sure about the reason yet), so I had to fix them. 

I think 0.7.0 target is not fully justified any more given the impact of the 
change became much more than I first meant to, so moving to 0.8.0 might to give 
us some time to test and make sure it works on all targets. I tested on U18, 
Mac and Win, but that's not all we need. 

Overall I still think that converting StringUtils to a namespace (which is 
should be, instead of a class) is a bit painful but necessary step we have to 
take. 




was (Author: aboda):
Let me write the history of this as I think that's going to explain this PR 
became this big.

I just saw multiple PRs recently where people had to do this manually, so I 
decided to extend StringUtils with a function that works mostly like join in 
Python.

I just wanted to add the template functions to allow concatenation of strings 
and numbers from different types of container. This shouldn't change anything, 
just add a couple of functions. Although I found that StringUtils is not a 
namespace, but a class. That's problematic as all the template functions added 
there become members, which prevents using SFINAE. 

Because of this I changed it to be a namespace, but that lead to either inline 
the functions or move them to a separate source file to avoid linking issues.

When I moved those out I got a bunch of linter errors, which only seem to 
appear for cpp files (I'm not sure about the reason yet), so I had to fix them. 

I think 0.7.0 target is not fully justified any more given the impact of the 
change became much more than I first meant to, so moving to 0.8.0 might to give 
us some time to test and make sure it works on all targets. I tested on U18, 
Mac and Win, but that's not all we need. 

Overall I still think that converting StringUtils to a namespace (which is 
should be, instead of a class) is a bit painful but necessary step we have to 
take. 



> Extend StringUtils with string join capability
> ----------------------------------------------
>
>                 Key: MINIFICPP-910
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-910
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Arpad Boda
>            Assignee: Arpad Boda
>            Priority: Major
>             Fix For: 0.7.0
>
>          Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> String join is frequently needed and MiNiFi code contains a lot of 
> copy-pasted implementations for that. A general solution should be provided. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to