Although I have set "Auto-hide the Dock" to On, the dock does not disappear. The icons on the desktop move a bit to the left so that they are partly covered by the dock, but the dock remains there as long as there is no maximized window covering it.
The first picture shows an extract of my desktop with auto-hide on, the second with auto-hide off.
The third picture shows what I wanted and what I got through @pomsky's answer.