@bitfield

Тег c++ в блоге bitfield

bitfield

Опечатка по Карри (ну, может по Чёрчу или по Клейсли):

Реализована команада 'SetProxy'.

bitfield
bitfield

мимими 1:

The "best" example of this maintainability problem could be found in the old implementation of the printf family of functions. The CRT provides 142 different variations of printf, but most of the behavior is the same for all of the functions, so there are a set of common implementation functions that do the bulk of the work. These common implementation functions were all defined in output.c in the CRT sources(1). This 2,696 line file had 223 conditionally compiled regions of code (#ifdef, #else, etc.), over half of which were in a single 1,400 line function. This file was compiled 12 different ways to generate all of the common implementation functions.

мимими 2:

We have converted most of the CRT sources to compile as C++, enabling us to replace many ugly C idioms with simpler and more advanced C++ constructs. The publicly callable functions are still declared as C functions, of course (extern "C" in C++), so they can still be called from C. But internally we now take full advantage of the C++ language and its many useful features.

мимими 3:

Before this refactoring, the sprintf functions, which write formatted data to a character buffer, were implemented by wrapping the result buffer in a temporary FILE object and then deferring to the equivalent fprintf function.

bitfield

Да они на свет лезут!

CXXINCS =  -I"D:/Language/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
bitfield

сотрудник напоролся на красивые грабли

void func(bool b) {
  printf("bool");
}

void func(std::string s) {
  printf("string");
}

int main() {
  func("aaa");
}

И ведь знаешь, почему так, но все равно можешь сделать ошибку.

bitfield

До 2015 года осталось меньше недели, а конь-ди-даты продолжают делать тестовое в VC6.

bitfield

Герб Саттер:
int v[2] = { 0, 0 };
int i = 0;
v[i++] = i++;
Если бы мы отменили УБ, чему бы вы хотели чтобы было равно v
1. 00
2. 01
3. 10
4. unspecifed / implementation-defined

Коммент:
I voted for other "11" because I think C++ should troll it’s users more.

bitfield

bitfield:
boost hana loki mpllibs ftmp metatest fatal
я правда видел только первые три
bialix:
ты сейчас дьявола вызвать пытался?

bitfield

first, make the C++ library accessible to Python (already done, in many cases), then, let your Haskell program use the Python interpreter to make calls into the C++ library

bitfield

Сотрудник попросил объяснить смысл ворнинга ("переменная затеняет член класса"), в результате нашли баг с синхронизацией

{
   scoped_lock(m_mutex);
   do_some_with_shared_data();
}

inb4: fix

{
   scoped_lock lock(m_mutex);
   do_some_with_shared_data();
}
bitfield
auto list = [](auto ...xs) { 
    return [=](auto access) { return access(xs...); }; 
};

auto head = [](auto xs) { 
    return xs([](auto first, auto ...rest) { return first; }); 
};

auto tail = [](auto xs) { 
    return xs([](auto first, auto ...rest) { return list(rest...); }); 
};

auto length = [](auto xs) { 
    return xs([](auto ...z) { return sizeof...(z); }); 
};

int len = length(list(1, '2', "3"));  // 3

Добавить пост

Вы можете выбрать до 10 файлов общим размером не более 10 МБ.
Для форматирования текста используется Markdown.