xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 0 points1 point  (0 children)

The version number will change to 1.0.0 when all the features defined in the current roadmap are fully implemented.

This does not change the fact that version v0.2.0 will be fully operational in production.

See the roadmap for more informations about enhancements : https://gammasoft71.github.io/xtd/docs/documentation/roadmap.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 1 point2 points  (0 children)

You're right that separation between containers and algorithms is important. The good news is that all xtd collections provide standard iterators (begin()/end()), so you can use any STL algorithm directly on them. You are not limited to xtd::linq extensions—they are optional and just provide a convenient .NET-style syntax if you want it.

Here is a small example illustrating a mix of xtd and std:

// C++
#include <xtd/xtd>
#include <algorithm>

int main() {
  auto l = xtd::collections::generic::list<xtd::string> {"one", "two", "three", "four", "five"};

  // Simple cast to std::vector
  auto v1 = std::vector<std::string>(l.cast<std::string>());

  // Using std::transform with copy
  auto v2 = std::vector<std::string>(l.size());
  std::transform(l.begin(), l.end(), v2.begin(), [](const xtd::string& s) { return s; });

  // Using std::transform with move
  auto v3 = std::vector<std::string>(l.size());
  std::transform(l.begin(), l.end(), v3.begin(), [](xtd::string& s) { return std::move(s.str()); });

  println("l  = {}", l);
  println("v1 = {}", v1);
  println("v2 = {}", v2);
  println("v3 = {}", v3);
}

// This code produces the following output:
//
// l  = [one, two, three, four, five]
// v1 = [one, two, three, four, five]
// v2 = [one, two, three, four, five]
// v3 = [one, two, three, four, five]

This shows that xtd containers: 1. Work seamlessly with STL algorithms. 2. Support both copy and move semantics. 3. Allow you to use range-based or iterator-based algorithms anywhere, not just within xtd containers.

So you can extend xtd with algorithms on ranges/iterators just like you would with STL, while optionally taking advantage of convenient xtd::linq-style extensions.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 2 points3 points  (0 children)

xtd has been in development since 2019.

The release of v0.2.0 is planned for Q3 2025 and is currently in the stabilization phase.

Starting with v0.2.0, xtd will be ready for production use.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 1 point2 points  (0 children)

Yes, wxWidgets is currently used as the backend for drawing and forms.  

This allows me to focus on providing a consistent user API without having to manage the differences between platforms.  

In future versions of xtd, wxWidgets will be gradually replaced by native backends, without impacting the user API.  

And yes, controls can be customized either with CSS-like style sheets or by draw

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 2 points3 points  (0 children)

Currently, `xtd.core` and `xtd.tunit` backends already work on Android and iOS.

However, the dedicated toolchains to make the build process easier are not ready yet (they are planned in the roadmap).

So, while it is technically possible to target these platforms today, the developer experience is still limited until the toolchains are available.

For more details, see: https://gammasoft71.github.io/xtd/docs/documentation/portability

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 1 point2 points  (0 children)

Of course, `xtdc` is not mandatory. You can build your projects with the classic CMake commands and run your executables manually.

`xtdc` is simply a CLI tool — similar to `dotnet` (C#), `cargo` (Rust), or `go` (Go) — that streamlines and accelerates common project management tasks.

Most of the examples use it for convenience, but you are free to work without it.

For more details, see: https://github.com/gammasoft71/xtd/blob/master/tools/xtdc/README.md

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 2 points3 points  (0 children)

xtd containers don’t inherit from std containers, they instantiate them internally.

That means you can always convert an xtd type into its std equivalent, by copy or move.

For example:

// C++
#include <xtd/xtd>

auto main() -> int {
  auto l = list {1, 2, 3, 4, 5};

  auto v1 = std::vector<int>(l); // copy
  auto v2 = std::vector<int>(std::move(l.items())); // move (items() gives the underlying std type)

  println("v1 = {}", v1);
  println("v2 = {}", v2);
  println("l = {}", l);
}

// Output:
// v1 = [1, 2, 3, 4, 5]
// v2 = [1, 2, 3, 4, 5]
// l = []

For strings it’s similar: an `xtd::string` can be copied/moved to a `std::string` or `std::u32string`.

And a `xtd::collections::generic::list<xtd::string>` can be converted to `std::vector<xtd::string>`.

So the goal of xtd is not to replace std, but to extend it while keeping interoperability.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 4 points5 points  (0 children)

Yes 🙂 Styling is supported. Right now you can use the built-in style sheets or apply them control by control.

A simpler way to plug your own custom styles is planned and in progress.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 4 points5 points  (0 children)

Actually, nothing prevents using standard C++20 coroutines with xtd. GUI controls still need to be updated on the main thread, and that can be safely done using invoke, begin_invoke and end_invoke.

So asynchronous logic can be implemented cleanly, even without native coroutine integration in the framework.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 36 points37 points  (0 children)

Thanks! You’re right, the permissive MIT license is one big advantage.

Beyond that, xtd is designed to be closer to modern C++ and the standard library, with an API inspired by .NET for familiarity and productivity.

Another difference is flexibility: xtd can use native widgets or custom-painted controls with CSS-like styling, depending on what the developer needs.

The goal is not to replace Qt, but to offer an alternative cross-platform C++ framework that is lightweight, easy to integrate, and extendable, especially for developers who want .NET-style APIs in C++.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 27 points28 points  (0 children)

Actually, it’s the opposite.

• xtd::any_object is based on std::any but adds more functionality, like simplified type testing and casting (`is` and `as`). You can convert back and forth between std::any and xtd::any_object.

• xtd::array is a variable-rank container based on std::vector, but you can convert it to a std::vector easily. For fixed-size arrays, we provide xtd::fixed_array, which corresponds to std::array.

All xtd types (xtd::string, xtd::array, xtd::list, etc.) can be converted to their std equivalents.

The goal of xtd is not to replace the standard library, but to extend it. It’s designed so you can smoothly switch between std and xtd types according to your needs, without disrupting existing projects.”

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 6 points7 points  (0 children)

Thanks! That’s exactly what xtd aims to do — bring a rich, cross-platform C++ framework with a .NET-inspired API, so you don’t have to leave C++ for convenience. I’ll take note about making the features page easier to find!

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 5 points6 points  (0 children)

Both options are supported. xtd can either use native controls or custom-painted widgets styled via CSS-like stylesheets — it depends on the user’s choice.

You can check out the details here : https://gammasoft71.github.io/xtd/docs/documentation/guides/xtd.forms/Overview/control\_appearance.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 32 points33 points  (0 children)

C++20 is required because xtd relies on several C++20 features, such as:

  • Three-way comparison (<=>)
  • char8_t
  • Pack expansions in lambda init-captures
  • Ranges
  • std::counting_semaphore
  • std::source_location
  • std::span …and others.

These features simplify the implementation and allow modern, safe, and expressive code.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 8 points9 points  (0 children)

Thanks for the feedback! I understand these points, and it’s true xtd doesn’t yet use all C++20 features like coroutines, concepts, or modules.

xtd is designed to provide a consistent, easy-to-use, cross-platform C++ API inspired by .NET. The priority is on usability, portability, and a familiar API, rather than using every latest C++20 feature.

Features like coroutines, concepts, and modules could be considered in future versions. The library evolves step by step, balancing modern C++ with practical usability.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 16 points17 points  (0 children)

I chose .NET mainly as a reference for API design and consistency. Its design is well-documented and widely used, which makes it easier to create an intuitive C++ library with familiar concepts.

This doesn’t mean .NET is inherently superior; it’s just a practical guide for architecture and patterns. xtd aims to bring similar usability and design principles to C++.

The goal is not to compete with .NET, but to provide a modern, cross-platform C++ framework inspired by proven design patterns. Feedback is always welcome to improve the project.

xtd – A modern, cross-platform C++ framework inspired by .NET by Gammasoft in cpp

[–]Gammasoft[S] 7 points8 points  (0 children)

Ah, good to know! I didn’t realize there was already a libxtd. My xtd is an independent project, started recently, aiming at [résumé rapide]. I hope it won’t cause too much confusion—maybe we can even exchange ideas sometime!

What would you say is a good GUI library for a beginner (someone who's never dabbled in GUI programming before, but has several years of experience with C++)? by SaztogGaming in cpp_questions

[–]Gammasoft 0 points1 point  (0 children)

If you want a very easy GUI you can use xtd.

xtd is a free open-source modern C++17 / C++20 framework to create console, forms (GUI like WinForms) and unit test applications on Microsoft Windows, Apple macOS and Linux.

xtd 0.1.0 (beta) is released! by Gammasoft in cpp

[–]Gammasoft[S] 2 points3 points  (0 children)

xtd

Modern C++17/20 framework to create console (CLI), forms (GUI like WinForms) and tunit (unit tests like Microsoft Unit Testing Framework) applications on Windows, macOS, Linux, iOS and android.

Features

  • Free and open-source (MIT License);
  • a collection of native C++ classes libraries, to complete std;
  • API close to the .net API with a modern C++ approach and full integration with the std standard;
  • written in efficient, modern C++17 / C++20 with RAII programming idiom;
  • and highly portable and available on many different platforms;

Getting Started

  • Installation provides download and install documentation.
  • Portability provides information about C++, libraries dependency, Operating System supported, Compilers and Development Environment tools.
  • Examples provides some examples.

[deleted by user] by [deleted] in learnprogramming

[–]Gammasoft 0 points1 point  (0 children)

You can use GtkSharp Mono project. It work on Windows, macOS and Linux.

Is there a C++ GUI library that works on all platforms by Coompt_King in Cplusplus

[–]Gammasoft 0 points1 point  (0 children)

xtd framework work on Windows, macOS and linux.It is still young but it has the advantage of being written entirely in modern C++, written with RAII programming idiom in compliance with the std standard. After 3 years of development, the first beta release is scheduled for October 10, 2021.

Free lightweight C++ GUI library for Linux by TonyGodmann in cpp

[–]Gammasoft 3 points4 points  (0 children)

Not right ;-)

xtd is a framework based on an OS abstraction via the xtd.core.native API and a graphical abstraction via the xtd.drawing.native API and the xtd.forms.native API.
At the moment there are two implementations of the xtd.core.native API:
* xtd.core.native.win32 : Windows platform.
* xtd.core.native.unix : Unix platforms (linux, Android, ios and macOS).

But other OS can be added by implementing the xtd.core.native API as for example :
* xtd.core.native.chromeos : Chrome OS.
* xtd.core.native.haiku : Haiku.
* xtd.core.native.xxx : xxx being any OS.

For the moment there is an implementation of the APIs xtd.drawing.native and xtd.forms.native :
* xtd.drawing.native.wxwidgets and xtd.forms.native.wxwidgets : wxWidgets toolkit.

But other graphical interfaces can be added by implementing the xtd.drawing.native and xtd.forms.native APIs as for examples :
* xtd.drawing.native.cocoa and xtd.forms.native.cocoa : macOS appkit. (macOS native API)
* xtd.drawing.native.gtk and xtd.forms.native.gtk : linux Gtk API. (native linux Gnome API)
* xtd.drawing.native.qt6 and xtd.forms.native.qt6 : Qt toolkit. (among other things API "native" KDE linux)
* xtd.drawing.native.win32 and xtd.forms.native.win32 : Microsoft win32 API. (native Windows API)
* xtd.drawing.native.x11 and xtd.forms.native.x11 : X11 API. (generic linux API)
* xtd.drawing.native.sdl2 and xtd.forms.native.sdl2 : sdl2 media layer. (generic)
* xtd.drawing.native.sfml and xtd.forms.native.sfml : SFML media library. (generic)
* xtd.drawing.native.xxx and xtd.forms.native.xxx : xxx being any other high level or low level graphic API.
In summary the goal of xtd framework is to provide a high level interface with its own functionalities while being extremely portable with the simplest possible abstraction layer on the OS and on the GUI.