2005-01-01から1ヶ月間の記事一覧

boost::mpl::placeholderの概観

#include <boost/mpl/int.hpp> #include <boost/mpl/plus.hpp> #include <boost/mpl/apply.hpp> #include <boost/mpl/assert.hpp> using namespace boost::mpl; // STEP0 BOOST_MPL_ASSERT_RELATION( ( apply< plus<_1,_2>, int_<6>, int_<7> >::type::value), ==, 13 ); // STEP0': synonym // 実際はint_<0>ではなくintegral_c</_1,_2></boost/mpl/assert.hpp></boost/mpl/apply.hpp></boost/mpl/plus.hpp></boost/mpl/int.hpp>

Exceptional C++ Styleのまとめ

C++

std::endlより'\n'を使う キーワードexport,auto,registerは使わない 例外仕様(Exception Specification)は使わない try-catchはほぼ使わない メンバ変数はprivateにする publicメンバ関数は非仮想関数にする(Nonvirtual Interface) 仮想関数はできる限りpri…

カレントフォルダパスを得る

WSH

function this_folder_path() { // Note: getFolder("."), shell.currentDirectory, // incredible if Arguments passed var nameThis = WScript.ScriptFullName; var namePath = nameThis.replace(/\\[^\\]+$/i, ""); return namePath; }

使用されない変数の警告を避ける

#include <boost/concept_check.hpp> template <> inline int power<0>(const int& a_m) { boost::ignore_unused_variable_warning(a_m); // a_m; return 1; }</boost/concept_check.hpp>

コンテナの要素のdelete

C++

#include <boost/lambda/bind.hpp> #include <boost/lambda/construct.hpp> #include <boost/lambda/lambda.hpp> #include <algorithm> namespace L = boost::lambda; namespace poost { template <typename T> inline const L::lambda_functor< L::lambda_functor_base< L::action<1, L::function_action<1> >, typename L…</typename></algorithm></boost/lambda/lambda.hpp></boost/lambda/construct.hpp></boost/lambda/bind.hpp>

mpl::eval_if_cの実装

template<bool C, typename F1, typename F2> struct eval_if_c :/*=*/ if_c<C,F1,F2>::type { };</c,f1,f2></bool>

setDefaultLookAndFeelDecoratedされたJFrameのリサイズ時の明滅を避ける

System.setProperty("sun.awt.noerasebackground", "true");

メインフレームの明滅について

マウスでメインフレームをリサイズすると、間違ったサイズを持ったウィンドウメッセージ(WM_WINDOWPOS***, WM_SIZE, etc)が送られてくる? マウスで左に大きくした場合、右端が明滅している。マウス操作によるリサイズを自前でするアプリケーションでは起こ…

Unwritten Law - I'm seeing red

i'm seeing red don't think you'll have to see my face again don't have much time for sympathy cause it never happened to me you're feeling blue now i think you bit off more than you could chew and now it's time to make a choice and all I w…