constexpr関数はコンパイル時処理。これはいい。実行時が霞んで見える。cpuの嬌声が聞こえてきそうだ
概要 従来for文しか使用できなかった初期化をif文とswitch文でも使えるようになった。 for文は下記のように初期化と条件式を同時に書くことができる。 初期化で宣言した変数はfor文のスコープのみで有効でありfor文の外では参照できない特徴がある。 if (status_code c = bar(); c != SUCCESS) { //ステータスコード c が成功ではなかったら、何かして、処理を終了する … return c; } else { //ステータスコード C が成功だったら、何かして、処理を続行する … } //この時点で c は無効 switch (Foo gadget{args}; auto s = gadget.status()) { case OK: //正常 gadget.zip(); break; case Warn: //異常だが、続行 gadget.lo
Get notified in your email when a new post is published to this blog Today we are excited to announce the release of the June 2017 update of the C/C++ extension for Visual Studio Code. This update enables semantic-aware member list auto-completion and improves the overall default IntelliSense behavior, providing a smoother out-of-box IntelliSense experience. If you haven’t tried it before, downloa
導入 Swiftにはポインタを表すための型として UnsafePointer<T> とその仲間達があります。CoreFoundationなどC言語のライブラリを使う時などに利用することになります。これらのポインタ型のAPIはとてもよく考えられた素晴らしいものです。この記事ではそれを紹介、解説します。C言語ユーザ、C++ユーザにとっても興味深い内容だと思います。(swift 3.0.2) ポインタ型には下記のものがあります。 基本ポインタ型 UnsafePointer<T> UnsafeMutablePointer<T> UnsafeRawPointer UnsafeMutableRawPointer UnsafeBufferPointer<T> UnsafeMutableBufferPointer<T> UnsafeRawBufferPointer UnsafeMutableRawBuff
スレッド間のデータのやり取りにstd::vector<t>は向かない 5年近く前のアーティクル:『C++11:スレッド・ライブラリひとめぐり』で、10万未満の素数の総数を求めるサンプルを示しました。これをベースに、素数の個数を求めるだけでなく、見つけた素数:int pを引数に関数オブジェクトf(int)を呼ぶよう少しばかり手を加えます。関数オブジェクト内でstd::vector<int<>に見つけた素数pを追加(push_back(p))します。シングルスレッドだとこんなコードになりますか。 #ifndef PRIME_H_ #define PRIME_H_ #include <mutex> #include <functional> #include <cmath> // nは素数? inline bool is_prime(int n) { int sqn = (int)sqrt((f
This article describes all the breaking changes from Visual Studio 2015 going back to Visual Studio 2003, and in this article the terms "new behavior" or "now" refer to Visual Studio 2015 and later. The terms "old behavior" and "before" refer to Visual Studio 2013 and earlier releases. For information about the latest version of Visual Studio, see What's new for C++ in Visual Studio and C++ confor
http://www.infoq.com/news/2014/05/dropbox-cpp-crossplatform-mobile? 1 comment | 0 points | by WazanovaNews ■ comment by Jshiike | 約3時間前 InfoQの記事を読んでもっと詳しく知りたいと思ったので、元ネタを確認して個人的に興味をもったポイントをまとめてみました。 昨年のMobile@ScaleでのStephen Poletto (Dropbox) とSean Beasusoleil (Mailbox)の講演 先日のUIKonf2014でのSteven Kabbes (Mailbox)の講演における、Core Dataまわりの取り組みのメモ UIKonf2014でのSteven Kabbes (Mailbox), Stephen Poletto (Carous
C++ってゅぅのゎ。。 関数から複数の値を返せないの。。。 そして言語仕様も複雑。。。 もぅマヂ無理。。。 Pythonしょ。。。 元ネタ:http://d.hatena.ne.jp/keyword/%A4%E2%A4%A5%A5%DE%A5%C2%CC%B5%CD%FD C++でも簡単に関数から複数の値を返すことができる! できるんです!(ただし、C++11以降) C++11から追加されたstd::tupleを使います。以下はサンプルコードです。 #include <iostream> #include <string> #include <tuple> std::tuple<int, char, std::string> GreatFunction() { return std::forward_as_tuple(9, 'q', "qiita"); } int main() { in
ジークレストでは、AWSを利用してアプリを開発しております。 今回は、AWSのAutoScalingで追加したインスタンスが不要になった際に、 監視対象から自動で除外させる方法をご紹介します。 監視対象の除外を自動化させることで誤検知や監視コストの無駄を減らします。 サーバ監視ツールは、mackarel(https://mackerel.io/ja/) を使っています。 Mackerelでは、一度登録されたホストやインスタンスを管理対象から除外することを 「退役」と呼んでいます。ここではその退役方法について説明します。 Mackerelには、OSシャットダウンが実行されると 自動退役されるオプションが標準で用意されています。 参考にされる方はこちら(https://mackerel.io/ja/docs/entry/howto/auto-scaling) ただし、自動退役設定オプションをO
2016/9/10(土) の「わんくま 横浜勉強会 #08」で @chomado さんと発表したセッションです。 解説エントリーも併せてご覧ください http://ytabuchi.hatenablog.com/entry/2016/09/12/003000 Xamarin.Forms が大変なのは View の調整です。すぐに動くものが必要なプロトタイプやモック、View 要件を調整できる自社アプリやクライアントさんとちゃんと話せて要件を調整できる受託案件などであれば、Xamarin.Forms の利点を最大限生かした効率のよい開発ができます。 私個人としては、地雷を踏む可能性が高くても Xamarin.Forms が大好きなのでこれからも愛を込めてガンガン推していきたいと思います。(Xamarin が Xamarin.Forms を推しているので、どんどん使いやすくなっていくはずという
You can use Visual C++ for Cross-Platform Mobile Development to edit, debug and deploy iOS code to the iOS Simulator or to an iOS device, but because of licensing restrictions, the code must be built and run remotely on a Mac. To build and run iOS apps using Visual Studio, you need to set up and configure the remote agent, vcremote, on your Mac. The remote agent handles build requests from Visual
Caution 記事中で符号なし整数の演算結果が負になる場合の挙動をUBとして紹介していますが、定義された動作でした。 N4318の As can be seen, per the standard the negative result wraps around from the maximum positive value for the simple minus operation の文章ちゃんと読んで、執筆時の私・・・ はじめに 最近、ツイッターを見ていると、プログラマの間でnull安全という言葉がバズっていますね。私も次のようなエントリを楽しく眺めていた訳です: null安全でない言語は、もはやレガシー言語だ null安全はいいぞ。だって、型安全はいいぞ。 null安全を誤解している人達へのメッセージ さてそんな中、少しだけ私の心に留まったエントリがこれです: null安全な言語
Launching a new app in the mobile age is hard. If you want to reach a wide audience, you usually have to make your client three times at minimum: once for Android, once for iOS, and once more for the Web. Building an app on three different platforms means three times the work, with three times as many bugs to squish. To make matters more complicated, these clients all use different programming lan
Update August 15, 2019: Five years after I wrote this, Dropbox’s Eyal Guthmann announced that Dropbox has completely backed off from this strategy of using C++ for code sharing between iOS and Android in favor of using each platform’s native languages and SDKs directly. Eyal’s article is a very honest account of the downsides of choosing a non-standard tech stack, from integrating with platform AP
理工系、特に電気情報系、の学生と技術者を対象としたVisual C++の解説を行います。ただし、初めてプログラムを学ぶ全くの初心者向けではありません。作成時期が異なるため、Visual C++のVersionが異なっていますが、本質的に変わりはありません。 本資料の一部のJava版が(株)翔泳社のウエブサイトCodeZineにありますので、こちらもご利用ください(Java版とある場所をクリックして下さい)。 (株)マイナビ出版より、「C#画像処理・数値プログラミング - Visual C# 2017対応 - (プレミアムブックス) 」が新たに発売されました。これは、2014年に同社より発売された「Visual C# 2013画像処理・数値プログラミング」を、最新のVisual Studio 2017で確認して書き直したものです。この本で紹介しているものは、下記「マイナビ」欄に「C#」で記し
はてな「今週のお題はテストです」 うるせえ! 私は書きたいことを書く。 SwiftはObjective-Cとの互換性があると聞いた。 であれば、もちろんC, C++も使えるはず、と思っていた。実際に、公式ドキュメントのAbout Swiftの項にも、 Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. と書いてある。しかし、C++との互換性があるとは書いていない。「CとObjective-Cの上に構築する」とは書いてあるものの、「C互換の制約に縛られずに」という部分も気になる。 ふと思ったのだが、Objective-Cでは、C++を使う場合、実装ファ
Did you know that you can build and debug C++ projects in Visual Studio Code with your compiler and debugger of choice? Although VS Code is a light-weight editor, you can set it up to resemble a full IDE, customizing IntelliSense, build, and debug configurations for your environment. There are two recommended approaches for building a C++ application in VS Code: Build with VS Code tasks Build with
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く