Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ BOOST_FORMAT
BOOST_HASH
BOOST_CONVERSION
BOOST_MATH
BOOST_OPTIONAL
BOOST_RANGE
BOOST_TOKENIZER
BOOST_TUPLE
Expand Down
2 changes: 1 addition & 1 deletion src/curses/formatted_color.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef NCMPCPP_FORMATTED_COLOR_H
#define NCMPCPP_FORMATTED_COLOR_H

#include <boost/optional.hpp>
#include <optional>
#include <boost/range/adaptor/reversed.hpp>
#include "curses/window.h"
#include "utility/storage_kind.h"
Expand Down
1 change: 1 addition & 0 deletions src/curses/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
***************************************************************************/

#include <algorithm>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <cstdlib>
Expand Down
5 changes: 3 additions & 2 deletions src/curses/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@

#include "curses.h"

#include <boost/optional.hpp>
#include <optional>
#include <functional>
#include <list>
#include <stack>
#include <vector>
#include <stdexcept>
#include <string>
#include <tuple>
#include <queue>
Expand Down Expand Up @@ -189,7 +190,7 @@ struct Color

std::istream &operator>>(std::istream &is, Color &f);

typedef boost::optional<Color> Border;
using Border = std::optional<Color>;

/// Terminal manipulation functions
enum class TermManip { ClearToEOL };
Expand Down
2 changes: 1 addition & 1 deletion src/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ inline bool operator!=(const SongTag &lhs, const SongTag &rhs) {
template <typename CharT>
using TagVector = std::vector<
std::pair<
boost::optional<SongTag>,
std::optional<SongTag>,
std::basic_string<CharT>
>
>;
Expand Down
2 changes: 1 addition & 1 deletion src/format_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ struct Printer: boost::static_visitor<Result>
if (st != nullptr)
acc.emplace_back(*st, s);
else
acc.emplace_back(boost::none, s);
acc.emplace_back(std::nullopt, s);
}
};
// When extracting tags from a song all the other properties should be
Expand Down
8 changes: 4 additions & 4 deletions src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ const MPD::Song *currentSong(const BaseScreen *screen)
void deleteSelectedSongsFromPlaylist(NC::Menu<MPD::Song> &playlist)
{
selectCurrentIfNoneSelected(playlist);
boost::optional<int> range_end;
std::optional<int> range_end;
Mpd.StartCommandsList();
for (auto &s : boost::adaptors::reverse(playlist))
{
if (s.isSelected())
{
s.setSelected(false);
if (range_end == boost::none)
if (!range_end.has_value())
range_end = s.value().getPosition() + 1;
}
else if (range_end != boost::none)
else if (range_end.has_value())
{
Mpd.DeleteRange(s.value().getPosition() + 1, *range_end);
range_end.reset();
}
}
if (range_end != boost::none)
if (range_end.has_value())
Mpd.DeleteRange(0, *range_end);
Mpd.CommitCommandsList();
}
Expand Down
8 changes: 4 additions & 4 deletions src/screens/playlist_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
***************************************************************************/

#include <algorithm>
#include <boost/optional.hpp>
#include <optional>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <cassert>

Expand Down Expand Up @@ -58,7 +58,7 @@ size_t RightColumnWidth;
std::string SongToString(const MPD::Song &s);
bool PlaylistEntryMatcher(const Regex::Regex &rx, const MPD::Playlist &playlist);
bool SongEntryMatcher(const Regex::Regex &rx, const MPD::Song &s);
boost::optional<size_t> GetSongIndexInPlaylist(MPD::Playlist playlist, const MPD::Song &song);
std::optional<size_t> GetSongIndexInPlaylist(MPD::Playlist playlist, const MPD::Song &song);
}

PlaylistEditor::PlaylistEditor()
Expand Down Expand Up @@ -587,15 +587,15 @@ bool SongEntryMatcher(const Regex::Regex &rx, const MPD::Song &s)
return Regex::search(SongToString(s), rx, Config.ignore_diacritics);
}

boost::optional<size_t> GetSongIndexInPlaylist(MPD::Playlist playlist, const MPD::Song &song)
std::optional<size_t> GetSongIndexInPlaylist(MPD::Playlist playlist, const MPD::Song &song)
{
size_t index = 0;
MPD::SongIterator it = Mpd.GetPlaylistContentNoInfo(playlist.path()), end;

for (;;)
{
if (it == end)
return boost::none;
return std::nullopt;
if (*it == song)
return index;

Expand Down
2 changes: 1 addition & 1 deletion src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ bool Configuration::read(const std::vector<std::string> &config_paths, bool igno
return screen;
});
p.add("startup_slave_screen", &startup_slave_screen_type, "", [](std::string v) {
boost::optional<ScreenType> screen;
std::optional<ScreenType> screen;
if (!v.empty())
{
screen = stringtoStartupScreenType(v);
Expand Down
4 changes: 2 additions & 2 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define NCMPCPP_SETTINGS_H

#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/optional.hpp>
#include <optional>
#include <boost/regex.hpp>
#include <cassert>
#include <vector>
Expand Down Expand Up @@ -218,7 +218,7 @@ struct Configuration
size_t current_item_inactive_column_suffix_length;

ScreenType startup_screen_type;
boost::optional<ScreenType> startup_slave_screen_type;
std::optional<ScreenType> startup_slave_screen_type;
std::vector<ScreenType> screen_sequence;

std::string random_exclude_pattern;
Expand Down
4 changes: 2 additions & 2 deletions src/utility/type_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ MPD::Song::GetFunction charToGetFunction(char c)
}
}

boost::optional<mpd_tag_type> getFunctionToTagType(MPD::Song::GetFunction f)
std::optional<mpd_tag_type> getFunctionToTagType(MPD::Song::GetFunction f)
{
if (f == &MPD::Song::getArtist)
return MPD_TAG_ARTIST;
Expand All @@ -228,7 +228,7 @@ boost::optional<mpd_tag_type> getFunctionToTagType(MPD::Song::GetFunction f)
else if (f == &MPD::Song::getComment)
return MPD_TAG_COMMENT;
else
return boost::none;
return std::nullopt;
}

std::string itemTypeToString(MPD::Item::Type type)
Expand Down
4 changes: 2 additions & 2 deletions src/utility/type_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef NCMPCPP_UTILITY_TYPE_CONVERSIONS_H
#define NCMPCPP_UTILITY_TYPE_CONVERSIONS_H

#include <boost/optional.hpp>
#include <optional>

#include "curses/window.h"
#include "mpdpp.h"
Expand All @@ -38,7 +38,7 @@ MPD::MutableSong::SetFunction tagTypeToSetFunction(mpd_tag_type tag);
mpd_tag_type charToTagType(char c);
MPD::Song::GetFunction charToGetFunction(char c);

boost::optional<mpd_tag_type> getFunctionToTagType(MPD::Song::GetFunction f);
std::optional<mpd_tag_type> getFunctionToTagType(MPD::Song::GetFunction f);

std::string itemTypeToString(MPD::Item::Type type);

Expand Down
Loading