From ff95d8161284d2e05f25eb906aa0f531109ce608 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 19 Oct 2024 02:23:13 +0200 Subject: [PATCH] Reduce reliance on boost - the easy part * boost::unordered_map -> std::unordered_map * BOOST_STATIC_ASSERT/static_assert * BOOST_FOREACH -> for * boost::tuple -> std::tuple/g * boost::math::isnormal -> std::isnormal * boost::container::set -> std::set * boost::none -> std::nullopt * boost::optional -> std::optional --- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/axis_view.h | 4 ++-- gtk2_ardour/editor.cc | 3 +-- gtk2_ardour/editor.h | 6 ++--- gtk2_ardour/editor_canvas_events.cc | 2 +- gtk2_ardour/editor_drag.cc | 4 ++-- gtk2_ardour/editor_sections.h | 4 ++-- gtk2_ardour/ghost_event.h | 4 ++-- gtk2_ardour/midi_view.h | 8 +++---- gtk2_ardour/mixer_group_tabs.cc | 3 +-- gtk2_ardour/mixer_strip.cc | 12 +++++----- gtk2_ardour/mixer_strip.h | 4 ++-- gtk2_ardour/mixer_ui.cc | 23 +++++++++---------- gtk2_ardour/note_base.cc | 2 +- gtk2_ardour/rec_info_box.cc | 2 +- gtk2_ardour/region_list_base.h | 4 ++-- gtk2_ardour/visibility_group.cc | 4 ++-- gtk2_ardour/visibility_group.h | 4 ++-- libs/ardour/ardour/disk_reader.h | 6 ++--- libs/ardour/ardour/disk_writer.h | 4 ++-- libs/ardour/ardour/playlist.h | 4 ++-- libs/ardour/ardour/plugin_manager.h | 3 +-- libs/ardour/ardour/session.h | 10 ++++---- libs/ardour/ardour/track.h | 4 ++-- libs/ardour/ardour/transport_fsm.h | 4 ++-- libs/ardour/ardour/transport_master.h | 12 +++++----- libs/ardour/ardour/transport_master_manager.h | 2 +- libs/ardour/ardour/vst3_plugin.h | 8 +++---- libs/ardour/dsp_filter.cc | 7 +++--- libs/ardour/engine_slave.cc | 2 +- libs/ardour/io.cc | 4 ++-- libs/ardour/ltc_slave.cc | 2 +- libs/ardour/midi_clock_slave.cc | 2 +- libs/ardour/mtc_slave.cc | 2 +- libs/ardour/route.cc | 2 +- libs/ardour/session.cc | 4 ++-- libs/ardour/session_state.cc | 8 +++---- libs/ardour/session_transport.cc | 2 +- libs/ardour/tempo_map_importer.cc | 2 +- libs/ardour/transport_fsm.cc | 11 ++++----- libs/ardour/transport_master_manager.cc | 2 +- libs/ardour/vst3_host.cc | 14 +++++------ .../audiographer/process_context.h | 3 +-- libs/audiographer/audiographer/type_utils.h | 3 +-- libs/backends/alsa/alsa_audiobackend.cc | 3 +-- libs/canvas/canvas/meter.h | 13 +++++------ libs/canvas/test/arrow.cc | 2 +- libs/canvas/test/group.cc | 10 ++++---- libs/canvas/test/polygon.cc | 2 +- libs/canvas/test/types.cc | 4 ++-- libs/midi++2/mtc.cc | 2 +- libs/midi++2/parser.cc | 6 ++--- libs/pbd/pbd/signals.h | 4 ++-- libs/surfaces/console1/console1.cc | 4 ++-- libs/surfaces/websockets/dispatcher.h | 4 ++-- libs/surfaces/websockets/server.h | 6 ++--- libs/widgets/widgets/fastmeter.h | 13 +++++------ libs/widgets/widgets/frame.h | 4 ++-- 58 files changed, 144 insertions(+), 155 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index a23fe35414..07bd90f827 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1459,7 +1459,7 @@ ARDOUR_UI::update_disk_space() return; } - boost::optional opt_samples = _session->available_capture_duration(); + std::optional opt_samples = _session->available_capture_duration(); samplecnt_t fr = _session->sample_rate(); if (fr == 0) { diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index a6e8eec919..3caa3ced87 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -24,7 +24,7 @@ #pragma once #include -#include +#include #include #include @@ -133,6 +133,6 @@ protected: Gtk::Label inactive_label; Gtk::Table inactive_table; - mutable boost::unordered_map property_hashtable; + mutable std::unordered_map property_hashtable; }; /* class AxisView */ diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index a30a2236cb..fb2fdaa2e3 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -46,7 +46,6 @@ * Apple's MacTypes.h and BarController. */ -#include #include @@ -1018,7 +1017,7 @@ Editor::deferred_control_scroll (samplepos_t /*target*/) { _session->request_locate (*_control_scroll_target); /* reset for next stream */ - _control_scroll_target = boost::none; + _control_scroll_target = std::nullopt; _dragging_playhead = false; return false; } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index a4622935c2..1e77445dad 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -532,7 +532,7 @@ private: bool constructed; // to keep track of the playhead position for control_scroll - boost::optional _control_scroll_target; + std::optional _control_scroll_target; SelectionPropertiesBox* _properties_box; @@ -580,7 +580,7 @@ private: void update_join_object_range_location (double); - boost::optional pre_notebook_shrink_pane_width; + std::optional pre_notebook_shrink_pane_width; Gtk::VBox _editor_list_vbox; Gtk::Notebook _the_notebook; diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 82be775b44..8871047511 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -152,7 +152,7 @@ bool Editor::canvas_scroll_event (GdkEventScroll *event, bool from_canvas) { if (from_canvas) { - boost::optional rulers = _time_markers_group->bounding_box(); + std::optional rulers = _time_markers_group->bounding_box(); if (rulers && rulers->contains (Duple (event->x, event->y))) { return canvas_ruler_event ((GdkEvent*) event, timecode_ruler, TimecodeRulerItem); } diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 700a7bfec1..a293e8e556 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1393,7 +1393,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) /* How high is this region view ? */ - boost::optional obbox = rv->get_canvas_group ()->bounding_box (); + std::optional obbox = rv->get_canvas_group ()->bounding_box (); ArdourCanvas::Rect bbox; if (obbox) { @@ -5122,7 +5122,7 @@ FeatureLineDrag::motion (GdkEvent*, bool) cx = 0; } - boost::optional bbox = _line->bounding_box (); + std::optional bbox = _line->bounding_box (); assert (bbox); _line->set (ArdourCanvas::Duple (cx, 2.0), ArdourCanvas::Duple (cx, bbox.value ().height ())); diff --git a/gtk2_ardour/editor_sections.h b/gtk2_ardour/editor_sections.h index 46c39f37ed..c7a0fa429b 100644 --- a/gtk2_ardour/editor_sections.h +++ b/gtk2_ardour/editor_sections.h @@ -19,7 +19,7 @@ #ifndef _gtk_ardour_editor_sections_h_ #define _gtk_ardour_editor_sections_h_ -#include +#include #include "ardour/location.h" #include "ardour/session_handle.h" @@ -108,7 +108,7 @@ private: Gtk::TreeModelColumn end; }; - typedef boost::unordered_map LocationRowMap; + typedef std::unordered_map LocationRowMap; Columns _columns; Glib::RefPtr _model; diff --git a/gtk2_ardour/ghost_event.h b/gtk2_ardour/ghost_event.h index 5b22a7be54..ed702973b5 100644 --- a/gtk2_ardour/ghost_event.h +++ b/gtk2_ardour/ghost_event.h @@ -1,7 +1,7 @@ #ifndef __gtk2_ardour_ghost_event_h__ #define __gtk2_ardour_ghost_event_h__ -#include +#include #include #include "evoral/Note.h" @@ -28,7 +28,7 @@ class GhostEvent : public sigc::trackable /* must match typedef in NoteBase */ typedef Evoral::Note NoteType; - typedef boost::unordered_map, GhostEvent* > EventList; + typedef std::unordered_map, GhostEvent* > EventList; static GhostEvent* find (std::shared_ptr parent, EventList& events, EventList::iterator& opti); }; diff --git a/gtk2_ardour/midi_view.h b/gtk2_ardour/midi_view.h index 3dcd95df26..843510f199 100644 --- a/gtk2_ardour/midi_view.h +++ b/gtk2_ardour/midi_view.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include @@ -478,9 +478,9 @@ class MidiView : public virtual sigc::trackable, public LineMerger uint8_t get_velocity_for_add (ARDOUR::MidiModel::TimeType time) const; uint8_t get_channel_for_add (ARDOUR::MidiModel::TimeType time) const; - typedef boost::unordered_map, NoteBase*> Events; - typedef boost::unordered_map > PatchChanges; - typedef boost::unordered_map > SysExes; + typedef std::unordered_map, NoteBase*> Events; + typedef std::unordered_map > PatchChanges; + typedef std::unordered_map > SysExes; typedef std::vector CopyDragEvents; std::shared_ptr _midi_track; diff --git a/gtk2_ardour/mixer_group_tabs.cc b/gtk2_ardour/mixer_group_tabs.cc index f9bf029611..548a5efe33 100644 --- a/gtk2_ardour/mixer_group_tabs.cc +++ b/gtk2_ardour/mixer_group_tabs.cc @@ -19,7 +19,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include #include "gtkmm2ext/utils.h" @@ -197,7 +196,7 @@ RouteList MixerGroupTabs::selected_routes () const { RouteList rl; - BOOST_FOREACH (AxisView* r, _mixer->selection().axes) { + for (AxisView* r : _mixer->selection().axes) { std::shared_ptr rp = std::dynamic_pointer_cast (r->stripable()); if (rp) { rl.push_back (rp); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index c8c3962b01..4251857e86 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1838,24 +1838,24 @@ MixerStrip::parameter_changed (string p) * * @return optional value that is present if visibility state should be overridden. */ -boost::optional +std::optional MixerStrip::override_solo_visibility () const { if (is_master ()) { - return boost::optional (false); + return std::optional (false); } - return boost::optional (); + return std::optional (); } -boost::optional +std::optional MixerStrip::override_rec_mon_visibility () const { if (is_master ()) { - return boost::optional (false); + return std::optional (false); } - return boost::optional (); + return std::optional (); } diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 42cc7997af..23489ea383 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -311,8 +311,8 @@ private: * the RC option editor. */ VisibilityGroup _visibility; - boost::optional override_solo_visibility () const; - boost::optional override_rec_mon_visibility () const; + std::optional override_solo_visibility () const; + std::optional override_rec_mon_visibility () const; PBD::ScopedConnectionList _config_connection; diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 5e646ce867..9c96e26705 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -33,7 +33,6 @@ #include #include -#include #include @@ -3775,7 +3774,7 @@ Mixer_UI::control_action (std::shared_ptr (Stripable::*get_control)() const) set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { std::shared_ptr s = r->stripable(); if (s) { ac = (s.get()->*get_control)(); @@ -3816,7 +3815,7 @@ Mixer_UI::selected_gaincontrols () { set_axis_targets_for_operation (); ControllableSet rv; - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { std::shared_ptr ac (ms->route()->gain_control()); @@ -3857,7 +3856,7 @@ Mixer_UI::unity_gain_action () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { std::shared_ptr s = r->stripable(); if (s) { std::shared_ptr ac = s->gain_control(); @@ -3873,7 +3872,7 @@ Mixer_UI::copy_processors () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->copy_processors (); @@ -3885,7 +3884,7 @@ Mixer_UI::cut_processors () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->cut_processors (); @@ -3897,7 +3896,7 @@ Mixer_UI::paste_processors () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->paste_processors (); @@ -3909,7 +3908,7 @@ Mixer_UI::select_all_processors () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->select_all_processors (); @@ -3921,7 +3920,7 @@ Mixer_UI::toggle_processors () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->toggle_processors (); @@ -3933,7 +3932,7 @@ Mixer_UI::ab_plugins () { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->ab_plugins (); @@ -3945,7 +3944,7 @@ void Mixer_UI::vca_assign (std::shared_ptr vca) { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->vca_assign (vca); @@ -3957,7 +3956,7 @@ void Mixer_UI::vca_unassign (std::shared_ptr vca) { set_axis_targets_for_operation (); - BOOST_FOREACH(AxisView* r, _axis_targets) { + for (AxisView* r : _axis_targets) { MixerStrip* ms = dynamic_cast (r); if (ms) { ms->vca_unassign (vca); diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc index ffbb9841ee..3392ccf36d 100644 --- a/gtk2_ardour/note_base.cc +++ b/gtk2_ardour/note_base.cc @@ -252,7 +252,7 @@ NoteBase::set_mouse_fractions (GdkEvent* ev) return; } - boost::optional bbox = _item->bounding_box (); + std::optional bbox = _item->bounding_box (); assert (bbox); _item->canvas_to_item (ix, iy); diff --git a/gtk2_ardour/rec_info_box.cc b/gtk2_ardour/rec_info_box.cc index ca51813429..a7108f59c1 100644 --- a/gtk2_ardour/rec_info_box.cc +++ b/gtk2_ardour/rec_info_box.cc @@ -318,7 +318,7 @@ RemainInfoBox::render (Cairo::RefPtr const& cr, cairo_rectangle_ } samplecnt_t sample_rate = _session->nominal_sample_rate (); - boost::optional opt_samples = _session->available_capture_duration (); + std::optional opt_samples = _session->available_capture_duration (); Gtkmm2ext::set_source_rgb_a (cr, UIConfiguration::instance ().color ("widget:bg"), .7); diff --git a/gtk2_ardour/region_list_base.h b/gtk2_ardour/region_list_base.h index fa48bc7e92..fc74c196d1 100644 --- a/gtk2_ardour/region_list_base.h +++ b/gtk2_ardour/region_list_base.h @@ -22,7 +22,7 @@ #ifndef _gtk_ardour_region_list_base_h_ #define _gtk_ardour_region_list_base_h_ -#include +#include #include #include @@ -236,7 +236,7 @@ protected: bool _no_redisplay; - typedef boost::unordered_map, Gtk::TreeModel::iterator> RegionRowMap; + typedef std::unordered_map, Gtk::TreeModel::iterator> RegionRowMap; RegionRowMap region_row_map; diff --git a/gtk2_ardour/visibility_group.cc b/gtk2_ardour/visibility_group.cc index 37c1d5493b..0429f4e82b 100644 --- a/gtk2_ardour/visibility_group.cc +++ b/gtk2_ardour/visibility_group.cc @@ -50,7 +50,7 @@ VisibilityGroup::VisibilityGroup (std::string const & name) */ void -VisibilityGroup::add (Gtk::Widget* widget, string const & id, string const & name, bool visible, boost::function ()> override) +VisibilityGroup::add (Gtk::Widget* widget, string const & id, string const & name, bool visible, boost::function ()> override) { Member m; m.widget = widget; @@ -92,7 +92,7 @@ bool VisibilityGroup::should_actually_be_visible (Member const & m) const { if (m.override) { - boost::optional o = m.override (); + std::optional o = m.override (); if (o) { return o.value (); } diff --git a/gtk2_ardour/visibility_group.h b/gtk2_ardour/visibility_group.h index 3d01fe58fa..6aa95e0dda 100644 --- a/gtk2_ardour/visibility_group.h +++ b/gtk2_ardour/visibility_group.h @@ -41,7 +41,7 @@ public: std::string const &, std::string const &, bool visible = false, - boost::function ()> = 0 + boost::function ()> = 0 ); Gtk::Widget* list_view (); @@ -64,7 +64,7 @@ private: std::string id; std::string name; bool visible; - boost::function ()> override; + boost::function ()> override; }; class ModelColumns : public Gtk::TreeModelColumnRecord { diff --git a/libs/ardour/ardour/disk_reader.h b/libs/ardour/ardour/disk_reader.h index 212cc39999..ce9d1961e6 100644 --- a/libs/ardour/ardour/disk_reader.h +++ b/libs/ardour/ardour/disk_reader.h @@ -22,7 +22,7 @@ #include -#include +#include #include "evoral/Curve.h" @@ -210,8 +210,8 @@ private: sampleoffset_t _declick_offs; bool _declick_enabled; MidiNoteTracker _tracker; - boost::optional _last_read_reversed; - boost::optional _last_read_loop; + std::optional _last_read_reversed; + std::optional _last_read_loop; static samplecnt_t _chunk_samples; diff --git a/libs/ardour/ardour/disk_writer.h b/libs/ardour/ardour/disk_writer.h index 9ee8f50687..23f14e90db 100644 --- a/libs/ardour/ardour/disk_writer.h +++ b/libs/ardour/ardour/disk_writer.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "ardour/disk_io.h" #include "ardour/event_ring_buffer.h" @@ -171,7 +171,7 @@ private: samplepos_t get_capture_start_sample_locked (uint32_t n = 0) const; - boost::optional _capture_start_sample; + std::optional _capture_start_sample; samplecnt_t _capture_captured; bool _was_recording; diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 6a56923ffd..7693f15b1f 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -35,7 +35,7 @@ #include -#include +#include #include @@ -471,7 +471,7 @@ private: void coalesce_and_check_crossfades (std::list); std::shared_ptr find_regions_at (timepos_t const &); - mutable boost::optional > _cached_extent; + mutable std::optional > _cached_extent; timepos_t _end_space; //this is used when we are pasting a range with extra space at the end bool _playlist_shift_active; diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 5e8d304181..2681433578 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -31,7 +31,6 @@ #include #include #include -#include #include "ardour/libardour_visibility.h" #include "ardour/types.h" @@ -193,7 +192,7 @@ private: } }; - typedef boost::container::set PluginScanLog; + typedef std::set PluginScanLog; PluginScanLog _plugin_scan_log; PSLEPtr scan_log_entry (PluginType const type, std::string const& path) { diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 85a9bb2534..4053206f3f 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -768,7 +768,7 @@ public: samplepos_t audible_sample (bool* latent_locate = NULL) const; samplepos_t requested_return_sample() const { return _requested_return_sample; } void set_requested_return_sample(samplepos_t return_to); - boost::optional const & nominal_jack_transport_sample() { return _nominal_jack_transport_sample; } + std::optional const & nominal_jack_transport_sample() { return _nominal_jack_transport_sample; } bool compute_audible_delta (samplepos_t& pos_and_delta) const; samplecnt_t remaining_latency_preroll () const { return _remaining_latency_preroll; } @@ -1051,7 +1051,7 @@ public: /* s/w "RAID" management */ - boost::optional available_capture_duration(); + std::optional available_capture_duration(); /* I/O bundles */ @@ -1435,8 +1435,8 @@ private: void add_surround_master (); void remove_surround_master (); - boost::optional _vapor_available; - boost::optional _vapor_exportable; + std::optional _vapor_available; + std::optional _vapor_exportable; void update_latency (bool playback); void set_owned_port_public_latency (bool playback); @@ -2317,7 +2317,7 @@ private: CoreSelection* _selection; bool _global_locate_pending; - boost::optional _nominal_jack_transport_sample; + std::optional _nominal_jack_transport_sample; bool _had_destructive_tracks; diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index dfb8d1cad0..650b910cb7 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -21,7 +21,7 @@ #pragma once -#include +#include #include #include "pbd/enum_convert.h" @@ -196,7 +196,7 @@ protected: void update_input_meter (); std::shared_ptr _playlists[DataType::num_types]; - boost::optional _saved_meter_point; + std::optional _saved_meter_point; bool _record_prepared; TrackMode _mode; diff --git a/libs/ardour/ardour/transport_fsm.h b/libs/ardour/ardour/transport_fsm.h index 4db990d74c..94b660f59f 100644 --- a/libs/ardour/ardour/transport_fsm.h +++ b/libs/ardour/ardour/transport_fsm.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -208,7 +208,7 @@ struct TransportFSM EventList queued_events; EventList deferred_events; int processing; - mutable boost::optional current_roll_after_locate_status; + mutable std::optional current_roll_after_locate_status; mutable double most_recently_requested_speed; mutable double _default_speed; int _reverse_after_declick; diff --git a/libs/ardour/ardour/transport_master.h b/libs/ardour/ardour/transport_master.h index 8d2fc37166..48810ae943 100644 --- a/libs/ardour/ardour/transport_master.h +++ b/libs/ardour/ardour/transport_master.h @@ -20,7 +20,7 @@ #include -#include +#include #include #include @@ -152,7 +152,7 @@ public: static std::shared_ptr factory (SyncSource, std::string const&, bool removeable); static std::shared_ptr factory (XMLNode const&); - virtual void pre_process (pframes_t nframes, samplepos_t now, boost::optional) = 0; + virtual void pre_process (pframes_t nframes, samplepos_t now, std::optional) = 0; /** * This is the most important function to implement: @@ -513,7 +513,7 @@ public: void set_session (Session*); - void pre_process (pframes_t nframes, samplepos_t now, boost::optional); + void pre_process (pframes_t nframes, samplepos_t now, std::optional); void unregister_port (); @@ -585,7 +585,7 @@ public: void set_session (Session*); - void pre_process (pframes_t nframes, samplepos_t now, boost::optional); + void pre_process (pframes_t nframes, samplepos_t now, std::optional); void reset (bool with_pos); bool locked () const; @@ -666,7 +666,7 @@ public: void unregister_port (); - void pre_process (pframes_t nframes, samplepos_t now, boost::optional); + void pre_process (pframes_t nframes, samplepos_t now, std::optional); void rebind (MidiPort&); @@ -737,7 +737,7 @@ public: Engine_TransportMaster (AudioEngine&); ~Engine_TransportMaster (); - void pre_process (pframes_t nframes, samplepos_t now, boost::optional); + void pre_process (pframes_t nframes, samplepos_t now, std::optional); bool speed_and_position (double& speed, samplepos_t& pos, samplepos_t&, samplepos_t&, samplepos_t); bool starting () const diff --git a/libs/ardour/ardour/transport_master_manager.h b/libs/ardour/ardour/transport_master_manager.h index 2b6d2772df..8251245140 100644 --- a/libs/ardour/ardour/transport_master_manager.h +++ b/libs/ardour/ardour/transport_master_manager.h @@ -117,7 +117,7 @@ class LIBARDOUR_API TransportMasterManager static TransportMasterManager* _instance; /* original TC format in case the slave changed it */ - boost::optional _session_tc_format; + std::optional _session_tc_format; void maybe_restore_tc_format (); void maybe_set_tc_format (); diff --git a/libs/ardour/ardour/vst3_plugin.h b/libs/ardour/ardour/vst3_plugin.h index 9bc671baa5..bffdc462b2 100644 --- a/libs/ardour/ardour/vst3_plugin.h +++ b/libs/ardour/ardour/vst3_plugin.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include "pbd/search_path.h" @@ -328,8 +328,8 @@ private: std::set _ac_subscriptions; bool _add_to_selection; - boost::optional _plugin_latency; - boost::optional _plugin_tail; + std::optional _plugin_latency; + std::optional _plugin_tail; int _n_bus_in; int _n_bus_out; @@ -486,7 +486,7 @@ public: bool is_instrument () const; PBD::Searchpath preset_search_path () const; - boost::optional has_editor; + std::optional has_editor; std::shared_ptr m; }; diff --git a/libs/ardour/dsp_filter.cc b/libs/ardour/dsp_filter.cc index d786ac0ab2..cf0adebb4c 100644 --- a/libs/ardour/dsp_filter.cc +++ b/libs/ardour/dsp_filter.cc @@ -18,7 +18,6 @@ */ #include -#include #include #include @@ -135,7 +134,7 @@ LowPass::proc (float* data, const uint32_t n_samples) _z = z; if (!isfinite_local (_z)) { _z = 0; - } else if (!boost::math::isnormal (_z)) { + } else if (!std::isnormal (_z)) { _z = 0; } } @@ -192,12 +191,12 @@ Biquad::run (float* data, const uint32_t n_samples) if (!isfinite_local (_z1)) { _z1 = 0; - } else if (!boost::math::isnormal (_z1)) { + } else if (!std::isnormal (_z1)) { _z1 = 0; } if (!isfinite_local (_z2)) { _z2 = 0; - } else if (!boost::math::isnormal (_z2)) { + } else if (!std::isnormal (_z2)) { _z2 = 0; } } diff --git a/libs/ardour/engine_slave.cc b/libs/ardour/engine_slave.cc index 4f948d7455..a19b7ea161 100644 --- a/libs/ardour/engine_slave.cc +++ b/libs/ardour/engine_slave.cc @@ -82,7 +82,7 @@ Engine_TransportMaster::ok() const } void -Engine_TransportMaster::pre_process (pframes_t, samplepos_t, boost::optional) +Engine_TransportMaster::pre_process (pframes_t, samplepos_t, std::optional) { /* nothing to do */ } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 8f66ca777f..91141fe5d5 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -224,7 +224,7 @@ IO::remove_port (std::shared_ptr port, void* src) ChanCount after = before; after.set (port->type(), after.get (port->type()) - 1); - boost::optional const r = PortCountChanging (after); /* EMIT SIGNAL */ + std::optional const r = PortCountChanging (after); /* EMIT SIGNAL */ if (r.value_or (false)) { return -1; } @@ -296,7 +296,7 @@ IO::add_port (string destination, void* src, DataType type) ChanCount after = before; after.set (type, after.get (type) + 1); - boost::optional const r = PortCountChanging (after); /* EMIT SIGNAL */ + std::optional const r = PortCountChanging (after); /* EMIT SIGNAL */ if (r.value_or (false)) { return -1; } diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc index a13f7c9467..8c642485a9 100644 --- a/libs/ardour/ltc_slave.cc +++ b/libs/ardour/ltc_slave.cc @@ -564,7 +564,7 @@ LTC_TransportMaster::process_ltc(samplepos_t const now) } void -LTC_TransportMaster::pre_process (ARDOUR::pframes_t nframes, samplepos_t now, boost::optional session_pos) +LTC_TransportMaster::pre_process (ARDOUR::pframes_t nframes, samplepos_t now, std::optional session_pos) { if (!_port) { reset (true); diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc index f42bbf1051..4843825a88 100644 --- a/libs/ardour/midi_clock_slave.cc +++ b/libs/ardour/midi_clock_slave.cc @@ -115,7 +115,7 @@ MIDIClock_TransportMaster::set_session (Session* s) } void -MIDIClock_TransportMaster::pre_process (MIDI::pframes_t nframes, samplepos_t now, boost::optional session_pos) +MIDIClock_TransportMaster::pre_process (MIDI::pframes_t nframes, samplepos_t now, std::optional session_pos) { /* Read and parse incoming MIDI */ if (!_midi_port) { diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index afa9318f3b..23a3bd1bea 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -125,7 +125,7 @@ MTC_TransportMaster::set_session (Session* s) } void -MTC_TransportMaster::pre_process (MIDI::pframes_t nframes, samplepos_t now, boost::optional session_pos) +MTC_TransportMaster::pre_process (MIDI::pframes_t nframes, samplepos_t now, std::optional session_pos) { /* Read and parse incoming MIDI */ diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 57ac1b5644..6db216edba 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1128,7 +1128,7 @@ Route::add_processors (const ProcessorList& others, std::shared_ptr b flags &= mask; if (flags != None) { - boost::optional rv = PluginSetup (std::dynamic_pointer_cast(shared_from_this ()), pi, flags); /* EMIT SIGNAL */ + std::optional rv = PluginSetup (std::dynamic_pointer_cast(shared_from_this ()), pi, flags); /* EMIT SIGNAL */ int mode = rv.value_or (0); switch (mode & 3) { case 1: diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index e0f9849a78..1c56aa0778 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -5815,13 +5815,13 @@ Session::graph_reordered (bool called_from_backend) /** @return Number of samples that there is disk space available to write, * if known. */ -boost::optional +std::optional Session::available_capture_duration () { Glib::Threads::Mutex::Lock lm (space_lock); if (_total_free_4k_blocks_uncertain) { - return boost::optional (); + return std::optional (); } float sample_bytes_on_disk = 4.0; // keep gcc happy diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index ef1dd754af..147106993e 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -978,7 +978,7 @@ Session::load_state (string snapshot_name, bool from_template) /* there is pending state from a crashed capture attempt */ - boost::optional r = AskAboutPendingState(); + std::optional r = AskAboutPendingState(); if (r.value_or (1)) { state_was_pending = true; } else { @@ -1717,7 +1717,7 @@ Session::set_state (const XMLNode& node, int version) bool reconfigured = false; while (!AudioEngine::instance()->running () || _base_sample_rate != AudioEngine::instance()->sample_rate ()) { - boost::optional r = AskAboutSampleRateMismatch (_base_sample_rate, _current_sample_rate); + std::optional r = AskAboutSampleRateMismatch (_base_sample_rate, _current_sample_rate); int rv = r.value_or (0); if (rv == 0 && AudioEngine::instance()->running ()) { /* continue with rate mismatch */ @@ -3482,7 +3482,7 @@ struct RegionCounter { int Session::ask_about_playlist_deletion (std::shared_ptr p) { - boost::optional r = AskAboutPlaylistDeletion (p); + std::optional r = AskAboutPlaylistDeletion (p); return r.value_or (1); } @@ -5296,7 +5296,7 @@ Session::save_as (SaveAs& saveas) /* tell someone "X percent, file M of N"; M is one-based */ - boost::optional res = saveas.Progress (fraction, cnt, all); + std::optional res = saveas.Progress (fraction, cnt, all); if (res) { keep_going = *res; diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 02df6e0f59..bd960563fe 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -190,7 +190,7 @@ Session::locate (samplepos_t target_sample, bool for_loop_end, bool force, bool // Update Timecode time _transport_sample = target_sample; - _nominal_jack_transport_sample = boost::none; + _nominal_jack_transport_sample = std::nullopt; /* Note that loop wrap-around locates do not need to call "seek" */ if (force || !for_loop_end) { diff --git a/libs/ardour/tempo_map_importer.cc b/libs/ardour/tempo_map_importer.cc index 93c27daa80..ab44173365 100644 --- a/libs/ardour/tempo_map_importer.cc +++ b/libs/ardour/tempo_map_importer.cc @@ -87,7 +87,7 @@ bool TempoMapImporter::_prepare_move () { // Prompt user for verification - boost::optional replace = Prompt (_("This will replace the current tempo map!\nAre you sure you want to do this?")); + std::optional replace = Prompt (_("This will replace the current tempo map!\nAre you sure you want to do this?")); return replace.value_or (false); } diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc index d7fb757501..1f99d9d130 100644 --- a/libs/ardour/transport_fsm.cc +++ b/libs/ardour/transport_fsm.cc @@ -19,7 +19,6 @@ #include -#include #include "pbd/error.h" #include "pbd/pthread_utils.h" @@ -104,7 +103,7 @@ TransportFSM::hard_stop () { _motion_state = Stopped; _last_locate.target = max_samplepos; - current_roll_after_locate_status = boost::none; + current_roll_after_locate_status = std::nullopt; _direction_state = Forwards; _transport_speed = 0; _reverse_after_declick = 0; @@ -484,7 +483,7 @@ TransportFSM::start_playback () DEBUG_TRACE (DEBUG::TFSMEvents, "start_playback\n"); _last_locate.target = max_samplepos; - current_roll_after_locate_status = boost::none; + current_roll_after_locate_status = std::nullopt; if (most_recently_requested_speed == std::numeric_limits::max()) { /* we started rolling without ever setting speed; that's an implicit @@ -504,7 +503,7 @@ TransportFSM::stop_playback (Event const & s) DEBUG_TRACE (DEBUG::TFSMEvents, "stop_playback\n"); _last_locate.target = max_samplepos; - current_roll_after_locate_status = boost::none; + current_roll_after_locate_status = std::nullopt; api->stop_transport (s.abort_capture, s.clear_state); } @@ -684,7 +683,7 @@ bool TransportFSM::should_roll_after_locate () const { bool roll = current_roll_after_locate_status.value_or (api->should_roll_after_locate ()); - current_roll_after_locate_status = boost::none; // used it + current_roll_after_locate_status = std::nullopt; // used it DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("should_roll_after_locate() ? %1\n", roll)); return roll; @@ -695,7 +694,7 @@ TransportFSM::roll_after_locate () const { bool for_loop = _last_locate.for_loop_end; DEBUG_TRACE (DEBUG::TFSMEvents, string_compose ("rolling after locate, was for_loop ? %1\n", for_loop)); - current_roll_after_locate_status = boost::none; + current_roll_after_locate_status = std::nullopt; if (most_recently_requested_speed == std::numeric_limits::max()) { /* we started rolling without ever setting speed; that's an implicit diff --git a/libs/ardour/transport_master_manager.cc b/libs/ardour/transport_master_manager.cc index 3c4c645f47..9741c4b3d6 100644 --- a/libs/ardour/transport_master_manager.cc +++ b/libs/ardour/transport_master_manager.cc @@ -160,7 +160,7 @@ TransportMasterManager::pre_process_transport_masters (pframes_t nframes, sample return 1.0; } - boost::optional session_pos; + std::optional session_pos; if (_session) { session_pos = _session->audible_sample(); diff --git a/libs/ardour/vst3_host.cc b/libs/ardour/vst3_host.cc index f690d95a09..7be431c64f 100644 --- a/libs/ardour/vst3_host.cc +++ b/libs/ardour/vst3_host.cc @@ -30,7 +30,7 @@ #endif #if SMTG_OS_LINUX -#include +#include #include #endif @@ -102,8 +102,8 @@ private: guint _source_id; }; - boost::unordered_map _event_handlers; - boost::unordered_map _timer_handlers; + std::unordered_map _event_handlers; + std::unordered_map _timer_handlers; static gboolean event (GIOChannel* source, GIOCondition condition, gpointer data) { @@ -132,11 +132,11 @@ public: void clear () { Glib::Threads::Mutex::Lock lm (_lock); - for (boost::unordered_map::const_iterator it = _event_handlers.begin (); it != _event_handlers.end (); ++it) { + for (std::unordered_map::const_iterator it = _event_handlers.begin (); it != _event_handlers.end (); ++it) { g_source_remove (it->second._source_id); g_io_channel_unref (it->second._gio_channel); } - for (boost::unordered_map::const_iterator it = _timer_handlers.begin (); it != _timer_handlers.end (); ++it) { + for (std::unordered_map::const_iterator it = _timer_handlers.begin (); it != _timer_handlers.end (); ++it) { g_source_remove (it->first); } _event_handlers.clear (); @@ -165,7 +165,7 @@ public: tresult rv = false; Glib::Threads::Mutex::Lock lm (_lock); - for (boost::unordered_map::const_iterator it = _event_handlers.begin (); it != _event_handlers.end ();) { + for (std::unordered_map::const_iterator it = _event_handlers.begin (); it != _event_handlers.end ();) { if (it->second._handler == handler) { g_source_remove (it->second._source_id); g_io_channel_unref (it->second._gio_channel); @@ -198,7 +198,7 @@ public: tresult rv = false; Glib::Threads::Mutex::Lock lm (_lock); - for (boost::unordered_map::const_iterator it = _timer_handlers.begin (); it != _timer_handlers.end ();) { + for (std::unordered_map::const_iterator it = _timer_handlers.begin (); it != _timer_handlers.end ();) { if (it->second == handler) { g_source_remove (it->first); it = _timer_handlers.erase (it); diff --git a/libs/audiographer/audiographer/process_context.h b/libs/audiographer/audiographer/process_context.h index 73528fddb8..4e0b08e74a 100644 --- a/libs/audiographer/audiographer/process_context.h +++ b/libs/audiographer/audiographer/process_context.h @@ -1,7 +1,6 @@ #ifndef AUDIOGRAPHER_PROCESS_CONTEXT_H #define AUDIOGRAPHER_PROCESS_CONTEXT_H -#include #include #include "audiographer/visibility.h" @@ -28,7 +27,7 @@ class /*LIBAUDIOGRAPHER_API*/ ProcessContext // This will need to be modified if if it's modified above static const ThrowLevel throwLevel = DEFAULT_THROW_LEVEL; - BOOST_STATIC_ASSERT (std::is_trivially_destructible::value); + static_assert (std::is_trivially_destructible::value); public: diff --git a/libs/audiographer/audiographer/type_utils.h b/libs/audiographer/audiographer/type_utils.h index a022d48d45..0dee5386a5 100644 --- a/libs/audiographer/audiographer/type_utils.h +++ b/libs/audiographer/audiographer/type_utils.h @@ -1,7 +1,6 @@ #ifndef AUDIOGRAPHER_TYPE_UTILS_H #define AUDIOGRAPHER_TYPE_UTILS_H -#include #include #include #include @@ -30,7 +29,7 @@ class LIBAUDIOGRAPHER_API TypeUtilsBase template class /*LIBAUDIOGRAPHER_API*/ TypeUtils : private TypeUtilsBase { - BOOST_STATIC_ASSERT (std::is_trivially_destructible::value); + static_assert (std::is_trivially_destructible::value); typedef std::bool_constant::value || std::is_signed::value> zero_fillable; diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 55432e5857..6578242f44 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -24,7 +24,6 @@ #include -#include #include #include "alsa_audiobackend.h" @@ -1002,7 +1001,7 @@ AlsaAudioBackend::_start (bool for_latency_measurement) boost::tokenizer > devs (ext, sep); - BOOST_FOREACH (const std::string& tmp, devs) { + for (const std::string& tmp : devs) { std::string dev (tmp); unsigned int sr = _samplerate; unsigned int spp = _samples_per_period; diff --git a/libs/canvas/canvas/meter.h b/libs/canvas/canvas/meter.h index e3ca56351d..41a2c3d5a2 100644 --- a/libs/canvas/canvas/meter.h +++ b/libs/canvas/canvas/meter.h @@ -20,8 +20,7 @@ #define __push2_meter_h__ #include -#include -#include +#include #include #include @@ -156,9 +155,9 @@ class Meter : public Item { || (dim == rhs.dim && stp == rhs.stp && cols < rhs.cols) || (dim == rhs.dim && stp == rhs.stp && cols == rhs.cols && style < rhs.style); } - boost::tuple dim; - boost::tuple stp; - boost::tuple cols; + std::tuple dim; + std::tuple stp; + std::tuple cols; int style; }; typedef std::map > Pattern10Map; @@ -172,8 +171,8 @@ class Meter : public Item { inline bool operator<(const PatternBgMapKey& rhs) const { return (dim < rhs.dim) || (dim == rhs.dim && cols < rhs.cols) || (dim == rhs.dim && cols == rhs.cols && (sh && !rhs.sh)); } - boost::tuple dim; - boost::tuple cols; + std::tuple dim; + std::tuple cols; bool sh; }; typedef std::map > PatternBgMap; diff --git a/libs/canvas/test/arrow.cc b/libs/canvas/test/arrow.cc index 2be958c6db..1f9ecc94fd 100644 --- a/libs/canvas/test/arrow.cc +++ b/libs/canvas/test/arrow.cc @@ -27,7 +27,7 @@ ArrowTest::bounding_box () arrow.set_outline_width (0); - boost::optional bbox = arrow.bounding_box (); + std::optional bbox = arrow.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); CPPUNIT_ASSERT (bbox.value().x0 == -6); diff --git a/libs/canvas/test/group.cc b/libs/canvas/test/group.cc index a6d7d8de54..a9b7c6bdd3 100644 --- a/libs/canvas/test/group.cc +++ b/libs/canvas/test/group.cc @@ -23,7 +23,7 @@ GroupTest::bounding_box () c.set_outline_width (0); Rectangle d (canvas.root(), Rect (33, 33, 64, 64)); d.set_outline_width (0); - boost::optional bbox = canvas.root()->bounding_box (); + std::optional bbox = canvas.root()->bounding_box (); /* check the bounding box */ CPPUNIT_ASSERT (bbox.is_initialized ()); @@ -51,7 +51,7 @@ GroupTest::null_bounding_box () Group empty (canvas.root()); - boost::optional bbox = empty.bounding_box (); + std::optional bbox = empty.bounding_box (); CPPUNIT_ASSERT (!bbox.is_initialized ()); } @@ -116,7 +116,7 @@ GroupTest::children_changing () a.set_outline_width (0); /* Check that initial bbox */ - boost::optional bbox = canvas.root()->bounding_box (); + std::optional bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); CPPUNIT_ASSERT (bbox.value().x0 == 0); CPPUNIT_ASSERT (bbox.value().y0 == 0); @@ -156,7 +156,7 @@ GroupTest::grandchildren_changing () a.set_outline_width (0); /* Check the initial bboxes */ - boost::optional bbox = canvas.root()->bounding_box (); + std::optional bbox = canvas.root()->bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); CPPUNIT_ASSERT (bbox.value().x0 == 0); CPPUNIT_ASSERT (bbox.value().y0 == 0); @@ -276,7 +276,7 @@ GroupTest::torture_add_items_at_point () } for (list::iterator j = rectangles.begin(); j != rectangles.end(); ++j) { - boost::optional bbox = (*j)->bounding_box (); + std::optional bbox = (*j)->bounding_box (); assert (bbox); if (bbox.value().contains (test)) { items_B.push_back (*j); diff --git a/libs/canvas/test/polygon.cc b/libs/canvas/test/polygon.cc index d117bb9223..ff9ce6a1b9 100644 --- a/libs/canvas/test/polygon.cc +++ b/libs/canvas/test/polygon.cc @@ -29,7 +29,7 @@ PolygonTest::bounding_box () /* should now have a bounding box around those points, taking into account default line width */ - boost::optional bbox = polygon.bounding_box (); + std::optional bbox = polygon.bounding_box (); CPPUNIT_ASSERT (bbox.is_initialized ()); CPPUNIT_ASSERT (bbox.value().x0 == -6.25); CPPUNIT_ASSERT (bbox.value().x1 == 6.25); diff --git a/libs/canvas/test/types.cc b/libs/canvas/test/types.cc index ba6baef149..1f5d97a2b9 100644 --- a/libs/canvas/test/types.cc +++ b/libs/canvas/test/types.cc @@ -12,7 +12,7 @@ TypesTest::intersect () { Rect a (0, 0, 1024, 1024); Rect b (0, 0, 512, 512); - boost::optional c = a.intersection (b); + std::optional c = a.intersection (b); CPPUNIT_ASSERT (c.is_initialized ()); CPPUNIT_ASSERT (c->x0 == 0); @@ -24,7 +24,7 @@ TypesTest::intersect () { Rect a (0, 0, 512, 512); Rect b (513, 513, 1024, 1024); - boost::optional c = a.intersection (b); + std::optional c = a.intersection (b); CPPUNIT_ASSERT (!c.is_initialized ()); } diff --git a/libs/midi++2/mtc.cc b/libs/midi++2/mtc.cc index 25d118372e..053a23b9c2 100644 --- a/libs/midi++2/mtc.cc +++ b/libs/midi++2/mtc.cc @@ -185,7 +185,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) true, just ignore this in terms of it being an error. */ - boost::optional res = mtc_skipped (); + std::optional res = mtc_skipped (); if (res.value_or (false)) { diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc index da75aec248..9907d48b09 100644 --- a/libs/midi++2/parser.cc +++ b/libs/midi++2/parser.cc @@ -325,7 +325,7 @@ void Parser::scanner (unsigned char inbyte) { bool statusbit; - boost::optional edit_result; + std::optional edit_result; // cerr << "parse: " << hex << (int) inbyte << dec << " state = " << state << " msgindex = " << msgindex << " runnable = " << runnable << endl; @@ -393,7 +393,7 @@ Parser::scanner (unsigned char inbyte) } if (rtmsg) { - boost::optional res = edit (&inbyte, 1); + std::optional res = edit (&inbyte, 1); if (res.value_or (1) >= 0 && !_offline) { realtime_msg (inbyte); @@ -430,7 +430,7 @@ Parser::scanner (unsigned char inbyte) #endif if (msgindex > 0) { - boost::optional res = edit (msgbuf, msgindex); + std::optional res = edit (msgbuf, msgindex); if (res.value_or (1) >= 0) { if (!possible_mmc (msgbuf, msgindex) || _mmc_forward) { diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index 8143e005a9..880489fd5f 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include "pbd/libpbd_visibility.h" #include "pbd/event_loop.h" @@ -87,7 +87,7 @@ template class /*LIBPBD_API*/ OptionalLastValue { public: - typedef boost::optional result_type; + typedef std::optional result_type; template result_type operator() (Iter first, Iter last) const { diff --git a/libs/surfaces/console1/console1.cc b/libs/surfaces/console1/console1.cc index 7e8c4cfc23..282da7d1ec 100644 --- a/libs/surfaces/console1/console1.cc +++ b/libs/surfaces/console1/console1.cc @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #include "pbd/abstract_ui.cc" // instantiate template #include "pbd/controllable.h" @@ -1112,7 +1112,7 @@ void Console1::create_strip_inventory () { DEBUG_TRACE (DEBUG::Console1, "create_strip_inventory()\n"); - boost::optional master_order; + std::optional master_order; strip_inventory.clear (); StripableList sl = session->get_stripables (); uint32_t index = 0; diff --git a/libs/surfaces/websockets/dispatcher.h b/libs/surfaces/websockets/dispatcher.h index 2928b82443..1d2d9d4c39 100644 --- a/libs/surfaces/websockets/dispatcher.h +++ b/libs/surfaces/websockets/dispatcher.h @@ -19,7 +19,7 @@ #ifndef _ardour_surface_websockets_dispatcher_h_ #define _ardour_surface_websockets_dispatcher_h_ -#include +#include #include "client.h" #include "component.h" @@ -39,7 +39,7 @@ public: private: typedef void (WebsocketsDispatcher::*DispatcherMethod) (Client, const NodeStateMessage&); - typedef boost::unordered_map NodeMethodMap; + typedef std::unordered_map NodeMethodMap; static NodeMethodMap _node_to_method; diff --git a/libs/surfaces/websockets/server.h b/libs/surfaces/websockets/server.h index cc2cc77d1c..2dceb5f2fb 100644 --- a/libs/surfaces/websockets/server.h +++ b/libs/surfaces/websockets/server.h @@ -19,7 +19,7 @@ #ifndef _ardour_surface_websockets_server_h_ #define _ardour_surface_websockets_server_h_ -#include +#include #include #include @@ -63,7 +63,7 @@ private: struct lws_context_creation_info _lws_info; struct lws_context* _lws_context; - typedef boost::unordered_map ClientContextMap; + typedef std::unordered_map ClientContextMap; ClientContextMap _client_ctx; ServerResources _resources; @@ -90,7 +90,7 @@ private: Glib::RefPtr _channel; - typedef boost::unordered_map LwsPollFdGlibSourceMap; + typedef std::unordered_map LwsPollFdGlibSourceMap; LwsPollFdGlibSourceMap _fd_ctx; bool _fd_callbacks; diff --git a/libs/widgets/widgets/fastmeter.h b/libs/widgets/widgets/fastmeter.h index f7cc53ccc7..cde924ce31 100644 --- a/libs/widgets/widgets/fastmeter.h +++ b/libs/widgets/widgets/fastmeter.h @@ -21,8 +21,7 @@ #define _WIDGETS_FAST_METER_H_ #include -#include -#include +#include #include #include "gtkmm2ext/cairo_widget.h" @@ -143,9 +142,9 @@ private: || (dim == rhs.dim && stp == rhs.stp && cols < rhs.cols) || (dim == rhs.dim && stp == rhs.stp && cols == rhs.cols && style < rhs.style); } - boost::tuple dim; - boost::tuple stp; - boost::tuple cols; + std::tuple dim; + std::tuple stp; + std::tuple cols; int style; }; typedef std::map > Pattern10Map; @@ -159,8 +158,8 @@ private: inline bool operator<(const PatternBgMapKey& rhs) const { return (dim < rhs.dim) || (dim == rhs.dim && cols < rhs.cols) || (dim == rhs.dim && cols == rhs.cols && (sh && !rhs.sh)); } - boost::tuple dim; - boost::tuple cols; + std::tuple dim; + std::tuple cols; bool sh; }; typedef std::map > PatternBgMap; diff --git a/libs/widgets/widgets/frame.h b/libs/widgets/widgets/frame.h index d6650f011c..b30d4d677e 100644 --- a/libs/widgets/widgets/frame.h +++ b/libs/widgets/widgets/frame.h @@ -19,7 +19,7 @@ #ifndef _WIDGETS_FRAME_H_ #define _WIDGETS_FRAME_H_ -#include +#include #include #include "gtkmm2ext/colors.h" @@ -65,7 +65,7 @@ private: sigc::connection _parent_style_change; Glib::RefPtr _layout; std::string _label_text; - boost::optional _edge_color; + std::optional _edge_color; GtkRequisition _min_size; int _border;