DS18B20 Switching pins during execution

Usually you’d not switch pins on an already instantiated sensor object but have one object per sensor with it’s own pin assigned once and for all.
Switching pins that way would only make (some) sense if the one sensor actually got moved from one pin to another in hardware.

  DS18B20 sensorOnPin1(D1);
  DS18B20 sensorOnPin2(D2);