Skip to content

Remove legacy LSL_CPP11#284

Open
myd7349 wants to merge 1 commit into
sccn:devfrom
SharpLSL:rm-legacy-macro
Open

Remove legacy LSL_CPP11#284
myd7349 wants to merge 1 commit into
sccn:devfrom
SharpLSL:rm-legacy-macro

Conversation

@myd7349

@myd7349 myd7349 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Before commit 62e5ad3:

class stream_inlet {
	template <typename T>
	bool pull_chunk_multiplexed(std::vector<T> &chunk, std::vector<double> *timestamps = nullptr,
		double timeout = 0.0, bool append = false) {
            // ...
#if __cplusplus > 199711L || _MSC_VER >= 1900
			chunk.insert(chunk.end(), std::make_move_iterator(sample.begin()),
				std::make_move_iterator(sample.end()));
#else
			chunk.insert(chunk.end(), sample.begin(), sample.end());
#endif
            // ...
	}
}

In commit 62e5ad3 (2020-12-27), LSL_CPP11 was introduced:

#ifndef LSL_CPP11
#if __cplusplus > 199711L || _MSC_VER >= 1900 || defined(LSL_DOXYGEN)
/// Feature macro to conditionally enable C++11 features
#define LSL_CPP11 1
#else
#define LSL_CPP11 0
#endif
#endif


// ...

class stream_inlet {
	template <typename T>
	bool pull_chunk_multiplexed(std::vector<T> &chunk, std::vector<double> *timestamps = nullptr,
		double timeout = 0.0, bool append = false) {
            // ...
#if LSL_CPP11
			chunk.insert(chunk.end(), std::make_move_iterator(sample.begin()),
				std::make_move_iterator(sample.end()));
#else
			chunk.insert(chunk.end(), sample.begin(), sample.end());
#endif
            // ...
	}
}

In commit d5fcdf1 (2021-01-29), the definition of LSL_CPP11 was removed.

At present, this is the only place in the entire codebase that still uses LSL_CPP11, and since LSL_CPP11 is no longer defined, this function is effectively using:

chunk.insert(chunk.end(), sample.begin(), sample.end());

rather than the move-semantics-optimized version that was originally introduced.

Given that the project now uses C++17, I think we can remove this conditional compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant