Giter VIP home page Giter VIP logo

Comments (3)

mclow avatar mclow commented on May 19, 2024 2

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.

rosenrodt avatar rosenrodt commented on May 19, 2024

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.

mclow avatar mclow commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.