Comments (3)
Since you didn't provide an actual test program, I wrote my own:
#include <iostream>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
namespace ba = boost::algorithm;
int main ()
{
std::string s("two, pi");
std::vector<std::string> v;
ba::split(v, s, ba::is_any_of(","));
for (auto const &st : v)
std::cout << "'" << st << "'" << std::endl;
std::cout << "-----" << std::endl;
for (auto st : v)
{
ba::trim(st);
std::cout << "'" << st << "'" << std::endl;
}
}
$ clang++ -std=c++14 -I $BOOST boost.cpp && ./a.out
'two'
' pi'
-----
'two'
'pi'
That looks fine to me.
One big BUT: this only happens to Linux cross-compiler targeting Android platform, downloaded from Android NDK page
Can you run this program on your platform and tell me what happens?
Also, what version of Boost are you using?
from algorithm.
Thanks! That I did not providing a minimal example was lazy on my part.
Here is the result of the test program you provided:
export compile=/mnt/d/tools/android/android_toolchain_linux/bin/aarch64-linux-android-clang++
$ $compile -std=c++14 -I /mnt/d/repo/boost_1_68_0 src/test.cpp
$ adb push a.out data/local && adb shell ./data/local/a.out
a.out: 1 file pushed. 8.8 MB/s (223432 bytes in 0.024s)
'two'
' pi'
-----
'two'
' p'
The Boost version I have is 1.68.0. Compiled with Android cross compiler under Windows Linux Subsystem
from algorithm.
The only difference that I can see is that you're using Boost 1.68.0, and I'm using trunk.
However, I don't think that code has changed since before 1.68.0 (checks - nope)
That's very odd. And the fact that it only fails when cross-compiling to ARM suggests a tool problem. Doesn't rule out a bug in Boost, though.
from algorithm.
Related Issues (20)
- Automated formatting
- new implementation for string split
- boost::algorithm::trim_copy() does not remove \b character HOT 1
- fast variadic string-concat
- variadic min/max/minmax HOT 1
- Modular Boost C++ Libraries Request HOT 2
- Several cxx algorithm headers are not self-sufficient/self-contained HOT 2
- std::upper_bound with iterator hint? HOT 3
- Potential memory leak? HOT 5
- search example should be updated HOT 2
- Lack of bidimensional for_each HOT 3
- `replace_all` in VC++ 7.1 doesn't work from 1.55 onwards in some circumstances. HOT 1
- boost::algorithm::split_regex hangs and consumes CPU on dangling alternatives
- The apply_permutation algorithm requires C++11 HOT 4
- boost::algorithm::split_regex doesn't work with boost::u32regex.
- Doc request: indicate constexpr support for algorithms
- Feature Request: Any plan to add trim support for string_view?
- algorithm/string -- find_all_regex() gives a compiler error when the result container is vector<iterator_range<string::iterator>>
- Any plan for C++20 container related algorithms such as std::erase(_if)? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algorithm.