Merge pull request #9054 from Orphis/cpp11

c++11: Remove compat header base/functional.h
This commit is contained in:
Henrik Rydgård 2016-10-12 13:11:36 +02:00 committed by GitHub
commit 0ae3c9cf34
46 changed files with 104 additions and 131 deletions

View File

@ -896,7 +896,6 @@ add_library(native STATIC
ext/native/base/colorutil.h
ext/native/base/display.cpp
ext/native/base/display.h
ext/native/base/functional.h
ext/native/base/linked_ptr.h
ext/native/base/logging.h
ext/native/base/mutex.h

View File

@ -32,11 +32,7 @@
#include <deque>
#include <list>
#include <set>
#if defined(MACGNUSTD)
#include <tr1/type_traits>
#else
#include <type_traits>
#endif
#include "Common.h"
#include "FileUtil.h"
@ -46,12 +42,6 @@
#include "../ext/snappy/snappy-c.h"
#endif
#if defined(MACGNUSTD)
namespace std {
using tr1::is_pointer;
}
#endif
template <class T>
struct LinkedListItem : public T
{

View File

@ -15,12 +15,12 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <functional>
#include "base/display.h"
#include "base/functional.h"
#include "base/NativeApp.h"
#include "ext/vjson/json.h"
#include "file/ini_file.h"

View File

@ -27,8 +27,9 @@
// https://github.com/hrydgard/ppsspp/issues/1078
#include <cstdlib>
#include <functional>
#include "base/basictypes.h"
#include "base/functional.h"
#include "base/mutex.h"
#include "profiler/profiler.h"
#include "thread/thread.h"

View File

@ -15,10 +15,10 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <functional>
#include <string>
#include <vector>
#include "base/functional.h"
#include "Common/ChunkFile.h"
namespace SaveState

View File

@ -607,22 +607,22 @@ bool TextureScaler::Scale(u32* &data, u32 &dstFmt, int &width, int &height, int
void TextureScaler::ScaleXBRZ(int factor, u32* source, u32* dest, int width, int height) {
xbrz::ScalerCfg cfg;
GlobalThreadPool::Loop(std::bind(&xbrz::scale, factor, source, dest, width, height, xbrz::ColorFormat::ARGB, cfg, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&xbrz::scale, factor, source, dest, width, height, xbrz::ColorFormat::ARGB, cfg, std::placeholders::_1, std::placeholders::_2), 0, height);
}
void TextureScaler::ScaleBilinear(int factor, u32* source, u32* dest, int width, int height) {
bufTmp1.resize(width*height*factor);
u32 *tmpBuf = bufTmp1.data();
GlobalThreadPool::Loop(std::bind(&bilinearH, factor, source, tmpBuf, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&bilinearV, factor, tmpBuf, dest, width, 0, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&bilinearH, factor, source, tmpBuf, width, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&bilinearV, factor, tmpBuf, dest, width, 0, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}
void TextureScaler::ScaleBicubicBSpline(int factor, u32* source, u32* dest, int width, int height) {
GlobalThreadPool::Loop(std::bind(&scaleBicubicBSpline, factor, source, dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&scaleBicubicBSpline, factor, source, dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}
void TextureScaler::ScaleBicubicMitchell(int factor, u32* source, u32* dest, int width, int height) {
GlobalThreadPool::Loop(std::bind(&scaleBicubicMitchell, factor, source, dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&scaleBicubicMitchell, factor, source, dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}
void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, int height, bool bicubic) {
@ -638,8 +638,8 @@ void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, i
bufTmp1.resize(width*height);
bufTmp2.resize(width*height*factor*factor);
bufTmp3.resize(width*height*factor*factor);
GlobalThreadPool::Loop(std::bind(&generateDistanceMask, source, bufTmp1.data(), width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convolve3x3, bufTmp1.data(), bufTmp2.data(), KERNEL_SPLAT, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&generateDistanceMask, source, bufTmp1.data(), width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convolve3x3, bufTmp1.data(), bufTmp2.data(), KERNEL_SPLAT, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
ScaleBilinear(factor, bufTmp2.data(), bufTmp3.data(), width, height);
// mask C is now in bufTmp3
@ -652,13 +652,13 @@ void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, i
// Now we can mix it all together
// The factor 8192 was found through practical testing on a variety of textures
GlobalThreadPool::Loop(std::bind(&mix, dest, bufTmp2.data(), bufTmp3.data(), 8192, width*factor, placeholder::_1, placeholder::_2), 0, height*factor);
GlobalThreadPool::Loop(std::bind(&mix, dest, bufTmp2.data(), bufTmp3.data(), 8192, width*factor, std::placeholders::_1, std::placeholders::_2), 0, height*factor);
}
void TextureScaler::DePosterize(u32* source, u32* dest, int width, int height) {
bufTmp3.resize(width*height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, source, bufTmp3.data(), width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, dest, bufTmp3.data(), width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, source, bufTmp3.data(), width, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, dest, bufTmp3.data(), width, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "Common/CommonTypes.h"
#include "GPU/Common/GPUDebugInterface.h"

View File

@ -47,15 +47,15 @@ void TextureScalerDX9::ConvertTo8888(u32 format, u32* source, u32* &dest, int wi
break;
case D3DFMT_A4R4G4B4:
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
case D3DFMT_R5G6B5:
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
case D3DFMT_A1R5G5B5:
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
default:

View File

@ -44,15 +44,15 @@ void TextureScalerGL::ConvertTo8888(u32 format, u32* source, u32* &dest, int wid
break;
case GL_UNSIGNED_SHORT_4_4_4_4:
GlobalThreadPool::Loop(std::bind(&convert4444_gl, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert4444_gl, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
case GL_UNSIGNED_SHORT_5_6_5:
GlobalThreadPool::Loop(std::bind(&convert565_gl, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert565_gl, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
case GL_UNSIGNED_SHORT_5_5_5_1:
GlobalThreadPool::Loop(std::bind(&convert5551_gl, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert5551_gl, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
default:

View File

@ -51,15 +51,15 @@ void TextureScalerVulkan::ConvertTo8888(u32 format, u32* source, u32* &dest, int
break;
case VULKAN_4444_FORMAT:
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
case VULKAN_565_FORMAT:
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
case VULKAN_1555_FORMAT:
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;
default:

View File

@ -176,19 +176,19 @@ void ControlMapper::MappedCallback(KeyDef kdf) {
UI::EventReturn ControlMapper::OnReplace(UI::EventParams &params) {
actionIndex_ = atoi(params.v->Tag().c_str());
action_ = REPLACEONE;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, placeholder::_1)));
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}
UI::EventReturn ControlMapper::OnReplaceAll(UI::EventParams &params) {
action_ = REPLACEALL;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, placeholder::_1)));
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}
UI::EventReturn ControlMapper::OnAdd(UI::EventParams &params) {
action_ = ADD;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, placeholder::_1)));
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}

View File

@ -17,8 +17,9 @@
#pragma once
#include <functional>
#include <vector>
#include "base/functional.h"
#include "base/mutex.h"
#include "ui/view.h"
#include "ui/ui_screen.h"

View File

@ -15,7 +15,8 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/functional.h"
#include <functional>
#include "ui/view.h"
#include "ui/ui_screen.h"
#include "ui/ui_context.h"

View File

@ -17,11 +17,11 @@
#pragma once
#include <vector>
#include <functional>
#include <map>
#include <string>
#include <vector>
#include "base/functional.h"
#include "file/file_util.h"
#include "ui/ui_screen.h"

View File

@ -175,7 +175,7 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
I18NCategory *ga = GetI18NCategory("Game");
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmGameConfig", "Do you really want to delete the settings for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GameScreen::CallbackDeleteConfig, this, placeholder::_1)));
std::bind(&GameScreen::CallbackDeleteConfig, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}
@ -289,7 +289,7 @@ UI::EventReturn GameScreen::OnDeleteSaveData(UI::EventParams &e) {
if (saveDirs.size()) {
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmAll", "Do you really want to delete all\nyour save data for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GameScreen::CallbackDeleteSaveData, this, placeholder::_1)));
std::bind(&GameScreen::CallbackDeleteSaveData, this, std::placeholders::_1)));
}
}
@ -313,7 +313,7 @@ UI::EventReturn GameScreen::OnDeleteGame(UI::EventParams &e) {
if (info) {
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmGame", "Do you really want to delete this game\nfrom your device? You can't undo this."), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GameScreen::CallbackDeleteGame, this, placeholder::_1)));
std::bind(&GameScreen::CallbackDeleteGame, this, std::placeholders::_1)));
}
return UI::EVENT_DONE;

View File

@ -17,8 +17,9 @@
#pragma once
#include <functional>
#include "UI/MiscScreens.h"
#include "base/functional.h"
#include "ui/ui_screen.h"
// Game screen: Allows you to start a game, delete saves, delete the game,

View File

@ -961,7 +961,7 @@ UI::EventReturn GameSettingsScreen::OnRenderingBackend(UI::EventParams &e) {
// It only makes sense to show the restart prompt if the backend was actually changed.
if (g_Config.iGPUBackend != (int)GetGPUBackend()) {
screenManager()->push(new PromptScreen(di->T("ChangingGPUBackends", "Changing GPU backends requires PPSSPP to restart. Restart now?"), di->T("Yes"), di->T("No"),
std::bind(&GameSettingsScreen::CallbackRenderingBackend, this, placeholder::_1)));
std::bind(&GameSettingsScreen::CallbackRenderingBackend, this, std::placeholders::_1)));
}
#endif
return UI::EVENT_DONE;
@ -1165,13 +1165,13 @@ UI::EventReturn GameSettingsScreen::OnRestoreDefaultSettings(UI::EventParams &e)
{
screenManager()->push(
new PromptScreen(dev->T("RestoreGameDefaultSettings", "Are you sure you want to restore the game-specific settings back to the ppsspp defaults?\n"), di->T("OK"), di->T("Cancel"),
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, placeholder::_1)));
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, std::placeholders::_1)));
}
else
{
screenManager()->push(
new PromptScreen(dev->T("RestoreDefaultSettings", "Are you sure you want to restore all settings(except control mapping)\nback to their defaults?\nYou can't undo this.\nPlease restart PPSSPP after restoring settings."), di->T("OK"), di->T("Cancel"),
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, placeholder::_1)));
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, std::placeholders::_1)));
}
return UI::EVENT_DONE;

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "ui/view.h"
#include "ui/ui_screen.h"

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "file/path.h"
#include "ui/ui_screen.h"
#include "ui/viewgroup.h"

View File

@ -16,8 +16,8 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <algorithm>
#include <functional>
#include "base/functional.h"
#include "base/colorutil.h"
#include "base/display.h"
#include "base/timeutil.h"

View File

@ -17,12 +17,12 @@
#pragma once
#include <vector>
#include <functional>
#include <map>
#include <string>
#include <vector>
#include "file/file_util.h"
#include "base/functional.h"
#include "ui/ui_screen.h"
struct ShaderInfo;

View File

@ -445,7 +445,7 @@ UI::EventReturn GamePauseScreen::OnDeleteConfig(UI::EventParams &e)
I18NCategory *ga = GetI18NCategory("Game");
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmGameConfig", "Do you really want to delete the settings for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GamePauseScreen::CallbackDeleteConfig, this, placeholder::_1)));
std::bind(&GamePauseScreen::CallbackDeleteConfig, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
#include "UI/MiscScreens.h"

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
#include "UI/MiscScreens.h"

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
#include "UI/MiscScreens.h"

View File

@ -17,9 +17,9 @@
#pragma once
#include <functional>
#include <string>
#include "base/functional.h"
#include "ui/ui_screen.h"
#include "ui/view.h"
#include "ui/viewgroup.h"

View File

@ -15,7 +15,8 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/functional.h"
#include <functional>
#include "base/basictypes.h"
#include "ext/vjson/json.h"
@ -135,7 +136,7 @@ void HttpImageFileView::DownloadCompletedCallback(http::Download &download) {
void HttpImageFileView::Draw(UIContext &dc) {
if (!texture_ && !textureFailed_ && !path_.empty() && !download_) {
download_ = downloader_->StartDownloadWithCallback(path_, "", std::bind(&HttpImageFileView::DownloadCompletedCallback, this, placeholder::_1));
download_ = downloader_->StartDownloadWithCallback(path_, "", std::bind(&HttpImageFileView::DownloadCompletedCallback, this, std::placeholders::_1));
download_->SetHidden(true);
}

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
#include "net/http_client.h"

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "ui/view.h"
#include "MiscScreens.h"

View File

@ -17,11 +17,12 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include <vector>
#include "ui/view.h"
#include "ui/viewgroup.h"
#include "MiscScreens.h"
#include <vector>
class DragDropButton;

View File

@ -15,11 +15,11 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <vector>
#include <string>
#include <functional>
#include <set>
#include <string>
#include <vector>
#include "base/functional.h"
#include "Common/ColorConv.h"
#include "Windows/GEDebugger/GEDebugger.h"
#include "Windows/GEDebugger/SimpleGLWindow.h"

View File

@ -17,7 +17,8 @@
#pragma once
#include "base/functional.h"
#include <functional>
#include "gfx_es2/glsl_program.h"
#include "Common/CommonWindows.h"
#include "Globals.h"

View File

@ -4,7 +4,8 @@
#include "stdafx.h"
#include "base/functional.h"
#include <functional>
#include "thread/thread.h"
#include "util/text/utf8.h"
#include "ShellUtil.h"

View File

@ -1,35 +0,0 @@
// This file simply includes <functional> and applies any necessary compatibility fixes for
// strange platforms like iOS.
// Use placeholder as the namespace for placeholders.
#pragma once
#include <functional>
#include <memory>
#include <vector>
#if defined(MACGNUSTD)
#include <tr1/functional>
#include <tr1/memory>
namespace std {
using tr1::bind;
using tr1::function;
using tr1::shared_ptr;
template <typename T>
inline shared_ptr<T> make_shared()
{
return shared_ptr<T>(new T());
}
template <typename T, typename Arg1>
inline shared_ptr<T> make_shared(Arg1& arg1)
{
return shared_ptr<T>(new T(arg1));
}
}
#endif
namespace placeholder = std::placeholders;

View File

@ -196,7 +196,6 @@
<ClInclude Include="base\colorutil.h" />
<ClInclude Include="base\compat.h" />
<ClInclude Include="base\display.h" />
<ClInclude Include="base\functional.h" />
<ClInclude Include="base\logging.h" />
<ClInclude Include="base\mutex.h" />
<ClInclude Include="base\NativeApp.h" />

View File

@ -203,9 +203,6 @@
<ClInclude Include="net\url.h">
<Filter>net</Filter>
</ClInclude>
<ClInclude Include="base\functional.h">
<Filter>base</Filter>
</ClInclude>
<ClInclude Include="ui\ui_screen.h">
<Filter>ui</Filter>
</ClInclude>

View File

@ -1,11 +1,12 @@
#ifndef _NET_HTTP_HTTP_CLIENT
#define _NET_HTTP_HTTP_CLIENT
#include <functional>
#include <memory>
#include "base/basictypes.h"
#include "base/buffer.h"
#include "thread/thread.h"
#include "base/functional.h"
#ifdef _WIN32
#define NOMINMAX

View File

@ -21,10 +21,11 @@
#endif
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include "base/functional.h"
#include "base/logging.h"
#include "base/buffer.h"
#include "file/fd_util.h"
@ -114,8 +115,8 @@ void Request::Close() {
Server::Server(threading::Executor *executor)
: port_(0), executor_(executor) {
RegisterHandler("/", std::bind(&Server::HandleListing, this, placeholder::_1));
SetFallbackHandler(std::bind(&Server::Handle404, this, placeholder::_1));
RegisterHandler("/", std::bind(&Server::HandleListing, this, std::placeholders::_1));
SetFallbackHandler(std::bind(&Server::Handle404, this, std::placeholders::_1));
}
void Server::RegisterHandler(const char *url_path, UrlHandlerFunc handler) {

View File

@ -1,9 +1,9 @@
#ifndef _HTTP_SERVER_H
#define _HTTP_SERVER_H
#include <functional>
#include <map>
#include "base/functional.h"
#include "base/buffer.h"
#include "net/http_headers.h"
#include "thread/executor.h"

View File

@ -1,5 +1,6 @@
#include "thread/executor.h"
#include "base/functional.h"
#include <functional>
namespace threading {

View File

@ -1,6 +1,6 @@
#pragma once
#include "base/functional.h"
#include <functional>
namespace threading {

View File

@ -1,4 +1,5 @@
#include "base/functional.h"
#include <functional>
#include "base/logging.h"
#include "base/timeutil.h"
#include "thread/thread.h"

View File

@ -1,8 +1,11 @@
#pragma once
#include <functional>
#include <memory>
#include <vector>
#include "thread.h"
#include "base/mutex.h"
#include "base/functional.h"
// This is the simplest possible worker implementation I can think of
// but entirely sufficient for the given purpose.

View File

@ -332,7 +332,7 @@ UI::EventReturn PopupMultiChoice::HandleClick(UI::EventParams &e) {
}
ListPopupScreen *popupScreen = new ListPopupScreen(ChopTitle(text_), choices, *value_ - minVal_,
std::bind(&PopupMultiChoice::ChoiceCallback, this, placeholder::_1));
std::bind(&PopupMultiChoice::ChoiceCallback, this, std::placeholders::_1));
popupScreen->SetHiddenChoices(hidden_);
screenManager_->push(popupScreen);
return UI::EVENT_DONE;

View File

@ -7,15 +7,15 @@
// Works very similarly to Android, there's a Measure pass and a Layout pass which you don't
// really need to care about if you just use the standard containers and widgets.
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <cstdio>
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/logging.h"
#include "base/functional.h"
#include "base/mutex.h"
#include "base/basictypes.h"
#include "gfx/texture_atlas.h"
@ -251,7 +251,7 @@ public:
// This is suggested for use in most cases. Autobinds, allowing for neat syntax.
template<class T>
T *Handle(T *thiz, EventReturn (T::* theCallback)(EventParams &e)) {
Add(std::bind(theCallback, thiz, placeholder::_1));
Add(std::bind(theCallback, thiz, std::placeholders::_1));
return thiz;
}

View File

@ -1,6 +1,6 @@
#include <functional>
#include <set>
#include "base/functional.h"
#include "base/logging.h"
#include "base/mutex.h"
#include "base/stringutil.h"
@ -1286,7 +1286,7 @@ void ListView::CreateAllItems() {
for (int i = 0; i < adaptor_->GetNumItems(); i++) {
if (hidden_.find(i) == hidden_.end()) {
View * v = linLayout_->Add(adaptor_->CreateItemView(i));
adaptor_->AddEventCallback(v, std::bind(&ListView::OnItemCallback, this, i, placeholder::_1));
adaptor_->AddEventCallback(v, std::bind(&ListView::OnItemCallback, this, i, std::placeholders::_1));
}
}
}